Beispiel #1
0
 private void Class1_ReceiveClusterIM(object sender, ReceiveClusterIMQQEventArgs e)
 {
     //MessageBox.Show("---:" + e.Message);
     LogUtil.log_call(form1, "::::" + e.Message);
     if (e.Message == "时间")
     {
         this.SendClusterMessage(e.Cluster, e.ClusterMember, "现在时间是:" + DateTime.Now.ToString());
         e.Cancel = true;//这里需要设置,放置后面的插件重复执行。表示已经处理完成了
         return;
     }
 }
Beispiel #2
0
        private void GroupMsg(object sender, ReceiveClusterIMQQEventArgs e)
        {
            String QQgroupInfo = e.Cluster.ToString();

            string[] sArray        = QQgroupInfo.Split(new string[] { "(", ")" }, StringSplitOptions.RemoveEmptyEntries);
            uint     QQGroupNumber = uint.Parse(sArray[1]);
            String   temp          = e.Message.ToString();

            if (e.Message == "测试")
            {
                SendClusterMessage(e.Cluster, e.ClusterMember, "测试成功!");
            }


            if (QQGroupNumber == 546726116 || QQGroupNumber == 372472368)
            {
                if (e.Message.IndexOf("dwz") > -1)
                {
                    String contentRules    = ".*?http.{0,10}dwz.cn..(.{6}).*?";
                    String newContentRules = ".*?http.{0,10}dwz.cn(.*)";
                    temp = e.Message;

                    if (e.Message.Contains(":"))
                    {
                        //新的链接
                        temp = RulesPackage(newContentRules, temp);
                        temp = System.Text.RegularExpressions.Regex.Unescape(temp).Trim();
                    }
                    else
                    {
                        temp = RulesPackage(contentRules, temp);
                        temp = "/" + System.Text.RegularExpressions.Regex.Unescape(temp).Trim();
                    }



                    GetSweet("http://dwz.cn" + temp);
                    GetSweetReply();


                    //               String temp2 = "http://dwz.cn/3sENri";
                    String test = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><msg serviceID=\"1\" templateID=\"1\" action=\"plugin\" brief=\"[Boom]\" sourcePublicUin=\"\" sourceMsgId=\"0\"  flag=\"2\" sType=\"\"> <item layout=\"0\"> <summary  size=\"30\" color=\"#FF0000\">用户名:" + PlayerName + "</summary><title size=\"30\" color=\"#7D26CD\">" + resultContent + "</title><hr hidden=\"false\"/><title size=\"30\" color=\"#2F4F2F\">欢迎使用西瓜机器人</title><title size=\"20\" color=\"#2F4F2F\">" + ads + "</title><hr hidden=\"false\"/><hr/></item><source name=\"萌萌哒小西瓜\" icon=\"http://dwz.cn/3jjnxQ\" action=\"\" appid=\"1\"/></msg>";
                    // String test = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><msg serviceID=\"1\" templateID=\"1\" action=\"plugin\" brief=\"棒棒糖到账信息\"sourcePublicUin=\"\" sourceMsgId=\"0\"  flag=\"2\" sType=\"\"> <item layout=\"0\"> <summary  size=\"30\" color=\"#FF0000\">用户名:" + PlayerName + "</summary><title size=\"30\" color=\"#7D26CD\">" + resultContent + "</title><hr hidden=\"false\"/><title size=\"30\" color=\"#2F4F2F\">欢迎使用西瓜机器人</title><title size=\"20\" color=\"#2F4F2F\">" + ads + "</title></item><hr hidden=\"false\" /></hr><item layout=\"0\"><button action=\"plugin\" url=\"http://dwz.cn/3sENri\">点击联系</button></item><source name=\"萌萌哒小西瓜\" icon=\"http://dwz.cn/3jjnxQ\"  url=\"http://dwz.cn/3sENri\"  action=\"plugin\" appid=\"0\"/></msg>";
                    this.SendClusterMessage(e.Cluster, e.ClusterMember, test);
                }
            }


//时间限制
            else if (e.Message.IndexOf("dwz") > -1 && isOpenSweet == 0)
            {
                resultContent = "现在无法使用刷棒棒糖功能!!可能情况为以下两点\n一、刷棒棒糖开放时间为8:00-22:00\n二、服务器阻塞,耐心等待~群主抢修中....\n\n如果急需刷棒棒糖请进入以下网站自行刷糖:\n http://www.54qiu.cn/ \n http://xzfuli.cn/";

                this.SendClusterMessage(e.Cluster, e.ClusterMember, resultContent);
            }
            else if (e.Message.IndexOf("dwz") > -1 && isOpenSweet == 1 && QQGroupNumber != 546726116)
            {
                String contentRules    = ".*?http.{0,10}dwz.cn..(.{6}).*?";
                String newContentRules = ".*?http.{0,10}dwz.cn(.*)";
                temp = e.Message;

                if (e.Message.Contains(":"))
                {
                    //新的链接
                    temp = RulesPackage(newContentRules, temp);
                    temp = System.Text.RegularExpressions.Regex.Unescape(temp).Trim();
                }
                else
                {
                    temp = RulesPackage(contentRules, temp);
                    temp = "/" + System.Text.RegularExpressions.Regex.Unescape(temp).Trim();
                }



                GetSweet("http://dwz.cn" + temp);
                GetSweetReply();


                //               String temp2 = "http://dwz.cn/3sENri";
                String test = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><msg serviceID=\"1\" templateID=\"1\" action=\"plugin\" brief=\"[Boom]\" sourcePublicUin=\"\" sourceMsgId=\"0\"  flag=\"2\" sType=\"\"> <item layout=\"0\"> <summary  size=\"30\" color=\"#FF0000\">用户名:" + PlayerName + "</summary><title size=\"30\" color=\"#7D26CD\">" + resultContent + "</title><hr hidden=\"false\"/><title size=\"30\" color=\"#2F4F2F\">欢迎使用西瓜机器人</title><title size=\"20\" color=\"#2F4F2F\">" + ads + "</title><hr hidden=\"false\"/><hr/></item><source name=\"萌萌哒小西瓜\" icon=\"http://dwz.cn/3jjnxQ\" action=\"\" appid=\"1\"/></msg>";
                // String test = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><msg serviceID=\"1\" templateID=\"1\" action=\"plugin\" brief=\"棒棒糖到账信息\"sourcePublicUin=\"\" sourceMsgId=\"0\"  flag=\"2\" sType=\"\"> <item layout=\"0\"> <summary  size=\"30\" color=\"#FF0000\">用户名:" + PlayerName + "</summary><title size=\"30\" color=\"#7D26CD\">" + resultContent + "</title><hr hidden=\"false\"/><title size=\"30\" color=\"#2F4F2F\">欢迎使用西瓜机器人</title><title size=\"20\" color=\"#2F4F2F\">" + ads + "</title></item><hr hidden=\"false\" /></hr><item layout=\"0\"><button action=\"plugin\" url=\"http://dwz.cn/3sENri\">点击联系</button></item><source name=\"萌萌哒小西瓜\" icon=\"http://dwz.cn/3jjnxQ\"  url=\"http://dwz.cn/3sENri\"  action=\"plugin\" appid=\"0\"/></msg>";
                this.SendClusterMessage(e.Cluster, e.ClusterMember, test);
            }
        }
 private void MainController_ReceiveClusterIM(object sender, ReceiveClusterIMQQEventArgs e)
 {
     Controllers.ClusterControllers.ClusterManagerController cm = new Controllers.ClusterControllers.ClusterManagerController(this, e);
     cm.Manager();
 }