public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
        {
            int    Prefix    = "切噜~[CQ:emoji,id=9834]".Length;
            String Msg       = e.Message.Text.Trim();
            String Encrypted = Msg.Substring(Msg.IndexOf("#") + 1);

            if (Encrypted.Length < 21)
            {
                return(ErrMsg);
            }
            if (Encrypted.Substring(0, Prefix) != "切噜~[CQ:emoji,id=9834]")
            {
                return(ErrMsg);
            }
            Encrypted = Encrypted.Substring(Prefix).Trim();
            try
            {
                //Regex reg = new Regex(@"\%5Cu(\w{4})");
                Regex  reg    = new Regex("切[{切卟叮咧哔唎啪啰啵嘭噜噼巴拉蹦铃}]+");
                String result = reg.Replace(Encrypted, delegate(Match m)
                {
                    return(Cheru2Word(m.Groups[0].Value));
                });
                return("你的切噜是:\n" + result);
            }
            catch
            {
                return(ErrMsg);
            }
        }
Beispiel #2
0
        public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
        {
            String str = e.Message.Text.Substring(e.Message.Text.IndexOf("#") + 1);

            if (str.Contains("CQ"))
            {
                return("切噜噜?");
            }
            Regex         reg = new Regex(@"\b");
            Regex         re  = new Regex(@"^\w+$");
            List <String> t   = new List <string>();
            List <String> l   = new List <string>();

            foreach (String i in reg.Split(str))
            {
                String _new = re.Replace(i, delegate(Match m)
                {
                    byte[] _str = Encoding.GetEncoding("GB2312").GetBytes(i);//获取GB编码Byte
                    for (int j = 0; j < _str.Length; j++)
                    {
                        t.Add(cheru[_str[j] & 0x0f]);        //取低四位
                        t.Add(cheru[(_str[j] & 0xf0) >> 4]); //取高四位
                    }
                    return("切" + String.Join("", t.ToArray()));
                });
                t.Clear();
                l.Add(_new);
            }
            return("你的歪比巴布是:\n切噜~♪" + String.Join("", l.ToArray()));
        }
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (e.FromGroup.SetGroupMemberBanSpeak(e.FromQQ, TimeSpan.FromMinutes(1)))
     {
         return("憨批");
     }
     return("有绿帽子就把你🐎都扬了");
 }
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (SQL.UserExists(b, e.FromQQ))
     {
         SQL.AddFavorEveryChat(b, e.FromQQ);
     }
     return(CQApi.CQCode_Image("pixiv/" + new Base_FileHelper().RandomGetImg("data/image/pixiv")).ToString());
 }
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (!SQL.UserExists(b, e.FromQQ))
     {
         return("不认识的孩子呢");
     }
     SQL.AddFavorEveryChat(b, e.FromQQ);
     return("余额是" + SQL.GetCash(b, e.FromQQ) + "水晶");
 }
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (e.FromGroup.SetGroupMemberBanSpeak(e.FromQQ, TimeSpan.FromHours(8)))
     {
         if (SQL.UserExists(b, e.FromQQ))
         {
             SQL.AddFavorEveryChat(b, e.FromQQ);
         }
         return("有个好梦~");
     }
     return("臣妾做不到啊");
 }
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (e.FromGroup.SetGroupMemberBanSpeak(e.FromQQ, TimeSpan.FromHours(2)))
     {
         if (SQL.UserExists(b, e.FromQQ))
         {
             SQL.AddFavorEveryChat(b, e.FromQQ);
         }
         return(CQApi.CQCode_Image("sm/cai.jpg").ToString());
     }
     return("臣妾做不到啊");
 }
Beispiel #8
0
        public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
        {
            if (!SQL.UserExists(b, e.FromQQ))
            {
                return("不认识的孩子呢");
            }
            SQL.AddFavorEveryChat(b, e.FromQQ);
            TimeSpan t = DateTime.Now.TimeOfDay;

            if (SQL.RenewSign(b, e.FromQQ))
            {
                if (t < LateNight)
                {
                    return("记得保温杯多泡枸杞\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else if (t < Overnight)
                {
                    return("在?才八点\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else if (t < EarlyMorning)
                {
                    return("今天好像很早desu,补作业?\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else if (t < Morning)
                {
                    return("早上好~\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else if (t < Forenoon)
                {
                    return("上午好!\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else if (t < Noon)
                {
                    return("做懒狗舒服吗?\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else if (t < Afternoon)
                {
                    return("午安~\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else if (t < Night)
                {
                    return("是展现真正技术的时候了!\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
                else
                {
                    return("[CQ:image,file=rand/5.jpg]\n签到成功,获得水晶" + SQL.DailySignWithCashUpdate(b, e.FromQQ).ToString());
                }
            }
            return("签过到了");
        }
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (!SQL.HasTable(b))
     {
         return("");
     }
     if (SQL.UserExists(b, e.FromQQ))
     {
         SQL.AddFavorEveryChat(b, e.FromQQ);
         String _reply = SQL.GetFavor(b, e.FromQQ).ToString();
         return("好感度" + _reply);
     }
     return("不认识的孩子呢");
 }
        public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
        {
            WebClient _Dl      = new WebClient();
            String    Filename = "rand/" + new Random().Next(10000, 99999).ToString() + ".jpg";

            try
            {
                _Dl.DownloadFile("http://ssr0.cn:8000/ACG", "data/image/" + Filename);
                return(CQApi.CQCode_Image(Filename).ToString());
            }
            catch
            {
                return("下载出错力");
            }
        }
Beispiel #11
0
 public String Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (!SQL.HasTable(b))
     {
         SQL.NewGroupTable(b);
     }
     if (!SQL.UserExists(b, e.FromQQ))
     {
         if (SQL.AddUser(b, e.FromQQ))
         {
             return("注册成功");
         }
         return("注册失败");
     }
     return("已经注册了");
 }
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     if (!SQL.HasTable(b))
     {
         return("");
     }
     if (SQL.UserExists(b, e.FromQQ))
     {
         SQL.AddFavorEveryChat(b, e.FromQQ);
         if (SQL.GetFavor(b, e.FromQQ) > 500)
         {
             return("来了来了");
         }
         return("恶心,恶心啊");
     }
     return("不认识的孩子呢");
 }
Beispiel #13
0
        public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
        {
            String _Order = e.Message.Text.Trim();
            String _Tag   = _Order.Contains("#") ? _Order.Substring(_Order.IndexOf("#") + 1).Trim():"";
            String Page   = _Tag == "" ?  new Random().Next(300).ToString():"1";

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://konachan.net/post.json?limit=30&tags=underwear " + _Tag + "&page=" + Page);

            request.UserAgent = UA;
            request.Proxy     = proxy;

            Img Infos;

            try
            {
                String raw  = new StreamReader(request.GetResponse().GetResponseStream(), Encoding.GetEncoding("UTF-8")).ReadToEnd();
                var    data = JsonConvert.DeserializeObject <Img[]>(raw);
                while (true)
                {
                    Infos = data[new Random().Next(data.Length)];
                    if (Infos.rating != "e" && Infos.score > 40)
                    {
                        request = (HttpWebRequest)WebRequest.Create(Infos.sample_url);
                        break;
                    }
                }
                request.UserAgent = UA;
                request.Proxy     = proxy;
                Stream     FileStream = request.GetResponse().GetResponseStream();
                String     Filename   = "rand/" + Infos.id.ToString() + "." + Infos.sample_url.Split(new char[] { '.' }).Last();
                FileStream LocalImg   = new FileStream("data/image/" + Filename, FileMode.OpenOrCreate, FileAccess.Write);
                byte[]     Buff       = new byte[512];
                int        Count      = 0;
                while ((Count = FileStream.Read(Buff, 0, Buff.Length)) > 0)
                {
                    LocalImg.Write(Buff, 0, Count);
                }
                FileStream.Close();
                LocalImg.Close();
                return(CQApi.CQCode_Image(Filename).ToString() + (Infos.author != "" ? "作者:" + Infos.author + "\n" : "") + (Infos.source != ""?"来源:" + Infos.source:""));
            }
            catch
            {
                return(ErrMsg);
            }
        }
Beispiel #14
0
        public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
        {
            String Order = e.Message.Text.Trim().Substring(22).Trim();
            String Music = Order.Substring(Order.IndexOf("#") + 1);
            String raw;

            //return Music;
            if (!SQL.UserExists(b, e.FromQQ))
            {
                return("不认识的孩子呢");
            }
            try
            {
                raw = Encoding.Default.GetString(HttpWebClient.Get("http://music.163.com/api/search/pc?limit=1&type=1&s=" + Music, UA));
            }
            catch
            {
                return("Network ERR");
            }
            try
            {
                reader = new JsonTextReader(new StringReader(raw));
                while (reader.Read())
                {
                    if (reader.TokenType.ToString() == "PropertyName" && reader.Value.ToString() == "id")
                    {
                        reader.Read();
                        SQL.AddFavorEveryChat(b, e.FromQQ);
                        return(CQApi.CQCode_Music(int.Parse(reader.Value.ToString()), Native.Sdk.Cqp.Enum.CQMusicType.Netease).ToString());
                    }
                }
                return("Music NOT found");
            }
            catch
            {
                return("Results ERR");
            }
        }
Beispiel #15
0
 public string Handler(CQGroupMessageEventArgs e, Base_SQLHelper.SQLHelperData b)
 {
     return("滴滴滴,出发警报\n关键词:你妈没了");
 }