Ejemplo n.º 1
0
        public override CoolQRouteMessage OnMessageReceived(CoolQScopeEventArgs scope)
        {
            var routeMsg = scope.RouteMessage;

            if (routeMsg.MessageType == MessageType.Private)
            {
                return(null);
            }

            string[] ids = CoolQCode.GetAt(routeMsg.RawMessage);
            if (ids == null || !ids.Contains(routeMsg.ReportMeta.SelfId))
            {
                return(null);
            }
            if (StaticRandom.NextDouble() < 0.9)
            {
                return(routeMsg
                       .ToSource("", true)
                       .RandomDelaySeconds(5));
            }
            else
            {
                var cqImg = new FileImage(Path.Combine(PandaDir, "at.jpg"));
                return(routeMsg.ToSource(cqImg.ToString()));
            }
        }
Ejemplo n.º 2
0
        public override CommonMessageResponse Message_Received(CommonMessage messageObj)
        {
            if (messageObj.MessageType == MessageType.Private)
            {
                return(null);
            }

            string[] ids = CqCode.GetAt(messageObj.Message);
            if (ids == null || !ids.Contains("2181697779") && !ids.Contains("3421735167"))
            {
                return(null);
            }
            Thread.Sleep(Rnd.Next(200, 300));
            if (Rnd.NextDouble() < 0.9)
            {
                return(new CommonMessageResponse("", messageObj, true));
            }
            else
            {
                var cqImg = new FileImage(Path.Combine(PandaDir, "at.jpg"));
                return(new CommonMessageResponse(cqImg.ToString(), messageObj));
            }
        }