Beispiel #1
0
        public void DiscussMessage(object sender, CQDiscussMessageEventArgs e)
        {
            InI     ini     = new InI(AppData.CQApi.AppDirectory + "main.ini");
            Getjson gt      = new Getjson();
            string  command = ini.ReadConfiguration("Command");
            string  str     = e.Message.Text;
            int     t       = command.Length;
            int     s       = str.Length;

            if (t < s)
            {
                string left = str.Substring(0, t);
                if (left == command)
                {
                    string a       = ini.ReadConfiguration("AllUse");
                    string manager = ini.ReadConfiguration("Manager");
                    if (a == "false" | manager == e.FromQQ.ToString())
                    {
                        string sending = gt.Get(str);
                        AppData.CQApi.SendPrivateMessage(e.FromQQ, sending);
                    }
                    else
                    {
                        string sending = gt.Get(str);
                        AppData.CQApi.SendPrivateMessage(e.FromQQ, sending);
                    }
                }
            }
        }
Beispiel #2
0
 public static int Event_eventDiscussMsg(int subType, int msgId, long fromDiscuss, long fromQQ, IntPtr msg, int font)
 {
     if (Event_eventDiscussMsgHandler != null)
     {
         CQDiscussMessageEventArgs args = new CQDiscussMessageEventArgs(api, log, 3, 4, "讨论组消息处理", "_eventDiscussMsg", 30000, subType, msgId, fromDiscuss, fromQQ, msg.ToString(CQApi.DefaultEncoding), false);
         Event_eventDiscussMsgHandler(typeof(CQEventExport), args);
     }
     return(0);
 }
Beispiel #3
0
 public static int Event_eventDiscussMsg(int subType, int msgId, long fromNative, long fromQQ, IntPtr msg, int font)
 {
     if (Event_eventDiscussMsgHandler != null)
     {
         CQDiscussMessageEventArgs args = new CQDiscussMessageEventArgs(AppData.CQApi, AppData.CQLog, 3, 4, "讨论组消息处理", "_eventDiscussMsg", 30000, subType, msgId, fromNative, fromQQ, msg.ToString(CQApi.DefaultEncoding), false);
         Event_eventDiscussMsgHandler(typeof(CQEventExport), args);
         return((int)(args.Handler ? CQMessageHandler.Intercept : CQMessageHandler.Ignore));
     }
     return(0);
 }
Beispiel #4
0
 public void DiscussMessage(object sender, CQDiscussMessageEventArgs e)
 {
     if (e.SubType == Sdk.Cqp.Enum.CQDiscussMessageType.Discuss)
     {
         LuaEnv.LuaStates.Run($"d{e.FromDiscuss.Id}", "DiscussMessage", new
         {
             fromDiscuss = e.FromDiscuss.Id,
             qq          = e.FromQQ.Id,
             msg         = e.Message.Text,
             id          = e.Message.Id,
         });;
     }
 }
 public void DiscussMessage(object sender, CQDiscussMessageEventArgs e)
 {
     if (e.Message.IsRegexMessage)
     {
         String cmd = "";
         e.Message.RegexResult.TryGetValue("cmd", out cmd);
         e.CQLog.Debug("Expected", $"cmd is {cmd}");
         e.CQApi.SendDiscussMessage(e.FromDiscuss, replyRaw("[CQ:at,qq=" + e.FromQQ.ToString() + "]", cmd, e.FromQQ.Id, e.FromDiscuss.Id));
     }
     else
     {
         String msg = e.Message;
         if (rx_normalcmd.IsMatch(msg))
         {
             DBManager.addGroupRelation(e.FromDiscuss, e.FromQQ.Id);
             // In a discussion group, everyone has the permission to operate.
             DBManager.addManager(e.FromDiscuss.Id, e.FromQQ.Id);
             Match  matches = rx_normalcmd.Match(msg);
             String cmd     = matches.Groups["cmd"].Value;
             e.CQLog.Debug("Expected", $"cmd is {cmd}");
             e.CQApi.SendDiscussMessage(e.FromDiscuss, replyRaw("[CQ:at,qq=" + e.FromQQ.ToString() + "]", cmd, e.FromQQ.Id, e.FromDiscuss.Id));
         }
     }
 }
Beispiel #6
0
        public void DiscussMessage(object sender, CQDiscussMessageEventArgs e)
        {
            if (CoolRepeater.DisabledGroups.Contains(e.FromDiscuss.Id))
            {
                return;
            }
            if (!CoolRepeater.EnabledGroups.Contains(e.FromDiscuss.Id))
            {
                return;
            }

            if (CoolRepeater.IgnorePicture &&
                e.Message.CQCodes.FirstOrDefault(c => c.Function == Native.Sdk.Cqp.Enum.CQFunction.Image) != null)
            {
                return;
            }

            var noContentMessage  = new QQMessage(e.CQApi, -1, string.Empty);
            var groupLastMessages = CoolRepeater.GroupLastMessages;

            if (!groupLastMessages.ContainsKey($"D{e.FromDiscuss.Id}"))
            {
                groupLastMessages.Add($"D{e.FromDiscuss.Id}", new Tuple <long, QQMessage>(e.FromQQ.Id, noContentMessage));
            }

            var groupMessageSenders = CoolRepeater.GropuMessageSenders;

            if (!groupMessageSenders.ContainsKey($"D{e.FromDiscuss.Id}"))
            {
                groupMessageSenders.Add($"D{e.FromDiscuss.Id}", new HashSet <long>());
            }

            var groupRepeatedMessage = CoolRepeater.GroupRepeatedMessages;

            if (!groupRepeatedMessage.ContainsKey($"D{e.FromDiscuss.Id}"))
            {
                groupRepeatedMessage.Add($"D{e.FromDiscuss.Id}", noContentMessage);
            }

            var lastMessage  = groupLastMessages[$"D{e.FromDiscuss.Id}"];
            var senders      = groupMessageSenders[$"D{e.FromDiscuss.Id}"];
            var lastRepeated = groupRepeatedMessage[$"D{e.FromDiscuss.Id}"];

            if (e.Message.Text != lastMessage.Item2.Text)
            {
                groupLastMessages[$"D{e.FromDiscuss.Id}"] = new Tuple <long, QQMessage>(e.FromQQ.Id, e.Message);
                senders.Clear();
                return;
            }
            else
            {
                senders.Add(e.FromQQ.Id);
            }

            if (lastRepeated.Text == e.Message.Text)
            {
                senders.Clear();
                return;
            }

            if (senders.Count >= (CoolRepeater.RepeatThreshold - 1))
            {
                var repeatString = e.Message.ToSendString();
                foreach (var s in CoolRepeater.BlockWords)
                {
                    if (repeatString.Contains(s))
                    {
                        senders.Clear();
                        return;
                    }
                }

                if ((decimal) new Random().NextDouble() <= CoolRepeater.RepeatProbability)
                {
                    if (CoolRepeater.GreaterChancesMoreRepeat)
                    {
                        senders.Clear();
                    }
                    return;
                }

                e.CQApi.SendDiscussMessage(e.FromDiscuss, repeatString);
                groupRepeatedMessage[$"D{e.FromDiscuss.Id}"] = e.Message;
                senders.Clear();
            }
        }
Beispiel #7
0
        public void DiscussMessage(object sender, CQDiscussMessageEventArgs e)
        {
            if (RobotInfo.BannedGroup.Contains(e.FromDiscuss.Id))
            {
                return;
            }

            if (RobotInfo.BannedUser.Contains(e.FromQQ.Id))
            {
                return;
            }

            if (RobotInfo.WhiteOnly && !RobotInfo.WhiteGroup.Contains(e.FromDiscuss.Id))
            {
                return;
            }

            // 获取 At 某人对象
            CQCode cqat = e.FromQQ.CQCode_At();

            if (e.Message.Text.StartsWith(RobotInfo.RobotName) || RobotInfo.UserHImageCmd.Contains(e.Message.Text))
            {
                string strHimageCommand = e.Message.Text.Substring(e.Message.Text.IndexOf(RobotInfo.RobotName) + RobotInfo.RobotName.Length);
                if (new Regex(RobotInfo.HImageCmd).IsMatch(strHimageCommand) || RobotInfo.UserHImageCmd.Contains(e.Message.Text))
                {
                    #region -- 次数限制 --

                    if (RobotInfo.Limit > 0 && (!RobotInfo.WhiteGroup.Contains(e.FromDiscuss.Id) || !RobotInfo.WhiteNoLimit))
                    {
                        if (!RobotInfo.AdminQQ.Contains(e.FromQQ.Id) || !RobotInfo.AdminNoLimit)
                        {
                            if (e.FromQQ.GetGroupMemberInfo(e.FromDiscuss.Id).MemberType == Sdk.Cqp.Enum.QQGroupMemberType.Member || !RobotInfo.ManageNoLimit)
                            {
                                if (RuntimeHelper.LimitDic.ContainsKey(e.FromQQ.Id))
                                {
                                    if (RuntimeHelper.LimitDic[e.FromQQ.Id] >= RobotInfo.Limit)
                                    {
                                        e.FromDiscuss.SendDiscussMessage(cqat, RobotInfo.OutOfLimitReply);
                                        return;
                                    }
                                }
                            }
                        }
                    }

                    #endregion -- 次数限制 --

                    #region -- 冷却时间 --

                    if (!RobotInfo.AdminQQ.Contains(e.FromQQ.Id) || !RobotInfo.AdminNoLimit)
                    {
                        if (e.FromQQ.GetGroupMemberInfo(e.FromDiscuss.Id).MemberType == Sdk.Cqp.Enum.QQGroupMemberType.Member || !RobotInfo.ManageNoLimit)
                        {
                            if (RobotInfo.WhiteGroup.Contains(e.FromDiscuss.Id))
                            {
                                if (RobotInfo.WhiteCD > 0)
                                {
                                    if (RuntimeHelper.WhiteCDDic.ContainsKey(e.FromQQ.Id))
                                    {
                                        if (RuntimeHelper.WhiteCDDic[e.FromQQ.Id] >= DateTime.Now)
                                        {
                                            e.FromDiscuss.SendDiscussMessage(cqat, RobotInfo.CDUnreadyReply);
                                            return;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (RobotInfo.CD > 0)
                                {
                                    if (RuntimeHelper.CDDic.ContainsKey(e.FromQQ.Id))
                                    {
                                        if (RuntimeHelper.CDDic[e.FromQQ.Id] >= DateTime.Now)
                                        {
                                            e.FromDiscuss.SendDiscussMessage(cqat, RobotInfo.CDUnreadyReply);
                                            return;
                                        }
                                    }
                                }
                            }
                        }
                    }

                    #endregion -- 冷却时间 --

                    try
                    {
                        Func <object, QQMessage> SendMessage = msg => e.FromDiscuss.SendDiscussMessage(msg);

                        Action RecordLimit = () => RuntimeHelper.RecordLimit(e.FromQQ.Id);

                        Action RecordCD = () => RuntimeHelper.RecordCD(e.FromQQ.Id, e.FromDiscuss.Id);

                        Action <QQMessage> RevokeHimage = msg => msg?.RevokeHImage(RobotInfo.WhiteGroup.Contains(e.FromDiscuss.Id) ? RobotInfo.WhiteRevoke : RobotInfo.Revoke);

                        strHimageCommand.SendHimages(RobotInfo.R18 && (!RobotInfo.R18WhiteOnly || RobotInfo.WhiteGroup.Contains(e.FromDiscuss.Id)), RecordLimit, RecordCD, SendMessage, RevokeHimage);

                        // 设置该属性, 表示阻塞本条消息, 该属性会在方法结束后传递给酷Q
                        e.Handler = true;
                    }
                    catch (Exception ex)
                    {
                        e.FromDiscuss.SendDiscussMessage(cqat, RobotInfo.ErrorReply);
                        INIHelper.WriteLog(Application.StartupPath + @"\HImageRobotError.log", ex.Message);
                    }
                }
            }
        }
Beispiel #8
0
        string mid_staff, title_staff, name_staff, face_staff, official, follower;            //if_data.staff=Int[],data.staff.[0/1/2]
        /// <summary>
        /// 收到讨论组消息
        /// </summary>
        /// <param name="sender">事件来源</param>
        /// <param name="e">事件参数</param>
        public void DiscussMessage(object sender, CQDiscussMessageEventArgs e)
        {
            string Msg = e.Message;

            if (Msg.Length >= 2)
            {
                if (Msg.Substring(0, 2) == "av")
                {
                    //HttpGet_Json
                    BiliBili_HttpGet_AV _HttpGet = new BiliBili_HttpGet_AV();
                    Json = _HttpGet.HttpGet(aid = Msg.Substring(2, Msg.Length - 2));
                    var _Jsonobj = JsonConvert.DeserializeObject <dynamic>(Json);
                    if (_Jsonobj.code == 0)
                    {
                        //History_Write
                        File.AppendAllText(e.CQApi.AppDirectory + "HistorySearch.txt", e.FromDiscuss + "的" + e.FromQQ + "获取了" + Msg + "\n", Encoding.UTF8);
                        //Image_Download
                        //Image_Download imagedl = new Image_Download();
                        //pic = _Jsonobj.data.pic;
                        //imagedl.Image_DL(pic,pic.Substring(32,pic.Length-32));
                        //CQFunction cqimage = CQFunction.Image;
                        //Voluation_Json->String/Int[]
                        //data.
                        bvid      = _Jsonobj.data.bvid;         //bv号
                        av        = "av" + _Jsonobj.data.aid;   //av号
                        title     = _Jsonobj.data.title;        //标题
                        videos    = _Jsonobj.data.videos;       //分P数量
                        tid       = _Jsonobj.data.tid;          //主分区
                        tname     = _Jsonobj.data.tname;        //子分区
                        copyright = _Jsonobj.data.copyright;    //版权信息
                        pubdate   = _Jsonobj.data.pubdate;      //投稿时间(时间戳
                        desc      = _Jsonobj.data.desc;         //简介
                        duration  = _Jsonobj.data.duration;     //视频持续时长(所有分P
                        //data.owner.
                        mid  = _Jsonobj.data.owner.mid;         //up主UID
                        name = _Jsonobj.data.owner.name;        //up主昵称
                        face = _Jsonobj.data.owner.face;        //up主头像地址
                        //data.stat.
                        view     = _Jsonobj.data.stat.view;     //观看数量
                        danmaku  = _Jsonobj.data.stat.danmaku;  //弹幕数量
                        reply    = _Jsonobj.data.stat.reply;    //评论数量
                        favorite = _Jsonobj.data.stat.favorite; //收藏数量
                        coin     = _Jsonobj.data.stat.coin;     //投币数量
                        share    = _Jsonobj.data.stat.share;    //分享数量
                        like     = _Jsonobj.data.stat.like;     //获赞数量
                        //data.pages[].
                        //pages = new int[] { _Jsonobj.data.pages };
                        //data.pages[0/1/2].
                        //if (videos != "0")
                        {
                            //目前不处理
                        }
                        //data.staff[].
                        //staff = new int[] { _Jsonobj.data.staff };
                        //data.staff[0/1/2].
                        //if( staff.Length != 1)
                        {
                            //目前不处理
                        }
                        //时间戳转换
                        Pubdate_Convert pubdate_Convert = new Pubdate_Convert();
                        datetime = pubdate_Convert.Pubdate(pubdate);
                        //主分区转换
                        Tid_Judge tid_judge = new Tid_Judge();
                        tidstr = tid_judge.Tid(Convert.ToInt32(tid));
                        //版权信息判断
                        Copyright_Judge copyright_judge = new Copyright_Judge();
                        copyrightstr = copyright_judge.Copyright(Convert.ToInt32(copyright));
                        //SendDiscussMessage
                        e.FromDiscuss.SendDiscussMessage(title + "[共" + videos + "P]" + "\n" + "bv号:" + bvid + "\n" + "av号:" + av + "\n" + "UP主:" + name + "\nUP主UID:" + mid + "\n" + "-----------------\n" + tidstr + ":" + tname + "\n" + "点赞:" + like + "  投币:" + coin + "\n收藏:" + favorite + "  观看:" + view + "\n弹幕:" + danmaku + "  评论:" + reply + "\n分享:" + share + "\n-----------------\n" + "简介:" + desc);
                    }
                    else
                    {
                        e.FromDiscuss.SendDiscussMessage("错误:\n" + "Code:" + _Jsonobj.code + "\n" + _Jsonobj.Message + "\n" + "错误码:\n400为请求错误\n404为找不到稿件\n62002为稿件不可见");
                    }
                }
                else if (Msg.Substring(0, 2) == "AV")
                {
                    BiliBili_HttpGet_AV _HttpGet = new BiliBili_HttpGet_AV();
                    Json = _HttpGet.HttpGet(aid = Msg.Substring(2, Msg.Length - 2));
                    var _Jsonobj = JsonConvert.DeserializeObject <dynamic>(Json);
                    if (_Jsonobj.code == 0)
                    {
                        //History_Write
                        File.AppendAllText(e.CQApi.AppDirectory + "HistorySearch.txt", e.FromDiscuss + "的" + e.FromQQ + "获取了" + Msg + "\n", Encoding.UTF8);
                        //Image_Download
                        //Image_Download imagedl = new Image_Download();
                        //pic = _Jsonobj.data.pic;
                        //imagedl.Image_DL(pic,pic.Substring(32,pic.Length-32));
                        //CQFunction cqimage = CQFunction.Image;
                        //Voluation_Json->String/Int[]
                        //data.
                        bvid      = _Jsonobj.data.bvid;         //bv号
                        av        = "av" + _Jsonobj.data.aid;   //av号
                        title     = _Jsonobj.data.title;        //标题
                        videos    = _Jsonobj.data.videos;       //分P数量
                        tid       = _Jsonobj.data.tid;          //主分区
                        tname     = _Jsonobj.data.tname;        //子分区
                        copyright = _Jsonobj.data.copyright;    //版权信息
                        pubdate   = _Jsonobj.data.pubdate;      //投稿时间(时间戳
                        desc      = _Jsonobj.data.desc;         //简介
                        duration  = _Jsonobj.data.duration;     //视频持续时长(所有分P
                        //data.owner.
                        mid  = _Jsonobj.data.owner.mid;         //up主UID
                        name = _Jsonobj.data.owner.name;        //up主昵称
                        face = _Jsonobj.data.owner.face;        //up主头像地址
                        //data.stat.
                        view     = _Jsonobj.data.stat.view;     //观看数量
                        danmaku  = _Jsonobj.data.stat.danmaku;  //弹幕数量
                        reply    = _Jsonobj.data.stat.reply;    //评论数量
                        favorite = _Jsonobj.data.stat.favorite; //收藏数量
                        coin     = _Jsonobj.data.stat.coin;     //投币数量
                        share    = _Jsonobj.data.stat.share;    //分享数量
                        like     = _Jsonobj.data.stat.like;     //获赞数量
                        //data.pages[].
                        //pages = new int[] { _Jsonobj.data.pages };
                        //data.pages[0/1/2].
                        //if (videos != "0")
                        {
                            //目前不处理
                        }
                        //data.staff[].
                        //staff = new int[] { _Jsonobj.data.staff };
                        //data.staff[0/1/2].
                        //if( staff.Length != 1)
                        {
                            //目前不处理
                        }
                        //时间戳转换
                        Pubdate_Convert pubdate_Convert = new Pubdate_Convert();
                        datetime = pubdate_Convert.Pubdate(pubdate);
                        //主分区转换
                        Tid_Judge tid_judge = new Tid_Judge();
                        tidstr = tid_judge.Tid(Convert.ToInt32(tid));
                        //版权信息判断
                        Copyright_Judge copyright_judge = new Copyright_Judge();
                        copyrightstr = copyright_judge.Copyright(Convert.ToInt32(copyright));
                        //SendDiscussMessage
                        e.FromDiscuss.SendDiscussMessage(title + "[共" + videos + "P]" + "\n" + "bv号:" + bvid + "\n" + "av号:" + av + "\n" + "UP主:" + name + "\nUP主UID:" + mid + "\n" + "-----------------\n" + tidstr + ":" + tname + "\n" + "点赞:" + like + "  投币:" + coin + "\n收藏:" + favorite + "  观看:" + view + "\n弹幕:" + danmaku + "  评论:" + reply + "\n分享:" + share + "\n-----------------\n" + "简介:" + desc);
                    }
                    else
                    {
                        e.FromDiscuss.SendDiscussMessage("错误:\n" + "Code:" + _Jsonobj.code + "\n" + _Jsonobj.Message + "\n" + "错误码:\n400为请求错误\n404为找不到稿件\n62002为稿件不可见");
                    }
                }
                else if (Msg.Substring(0, 2) == "BV")
                {
                    BiliBili_HttpGet_BV _HttpGet = new BiliBili_HttpGet_BV();
                    Json = _HttpGet.HttpGet(bvid = Msg.Substring(2, Msg.Length - 2));
                    var _Jsonobj = JsonConvert.DeserializeObject <dynamic>(Json);
                    if (_Jsonobj.code == 0)
                    {
                        //History_Write
                        File.AppendAllText(e.CQApi.AppDirectory + "HistorySearch.txt", e.FromDiscuss + "的" + e.FromQQ + "获取了" + Msg + "\n", Encoding.UTF8);
                        //Image_Download
                        //Image_Download imagedl = new Image_Download();
                        //pic = _Jsonobj.data.pic;
                        //imagedl.Image_DL(pic,pic.Substring(32,pic.Length-32));
                        //CQFunction cqimage = CQFunction.Image;
                        //Voluation_Json->String/Int[]
                        //data.
                        bvid      = _Jsonobj.data.bvid;         //bv号
                        av        = "av" + _Jsonobj.data.aid;   //av号
                        title     = _Jsonobj.data.title;        //标题
                        videos    = _Jsonobj.data.videos;       //分P数量
                        tid       = _Jsonobj.data.tid;          //主分区
                        tname     = _Jsonobj.data.tname;        //子分区
                        copyright = _Jsonobj.data.copyright;    //版权信息
                        pubdate   = _Jsonobj.data.pubdate;      //投稿时间(时间戳
                        desc      = _Jsonobj.data.desc;         //简介
                        duration  = _Jsonobj.data.duration;     //视频持续时长(所有分P
                        //data.owner.
                        mid  = _Jsonobj.data.owner.mid;         //up主UID
                        name = _Jsonobj.data.owner.name;        //up主昵称
                        face = _Jsonobj.data.owner.face;        //up主头像地址
                        //data.stat.
                        view     = _Jsonobj.data.stat.view;     //观看数量
                        danmaku  = _Jsonobj.data.stat.danmaku;  //弹幕数量
                        reply    = _Jsonobj.data.stat.reply;    //评论数量
                        favorite = _Jsonobj.data.stat.favorite; //收藏数量
                        coin     = _Jsonobj.data.stat.coin;     //投币数量
                        share    = _Jsonobj.data.stat.share;    //分享数量
                        like     = _Jsonobj.data.stat.like;     //获赞数量
                        //data.pages[].
                        //pages = new int[] { _Jsonobj.data.pages };
                        //data.pages[0/1/2].
                        //if (videos != "0")
                        {
                            //目前不处理
                        }
                        //data.staff[].
                        //staff = new int[] { _Jsonobj.data.staff };
                        //data.staff[0/1/2].
                        //if( staff.Length != 1)
                        {
                            //目前不处理
                        }
                        //时间戳转换
                        Pubdate_Convert pubdate_Convert = new Pubdate_Convert();
                        datetime = pubdate_Convert.Pubdate(pubdate);
                        //主分区转换
                        Tid_Judge tid_judge = new Tid_Judge();
                        tidstr = tid_judge.Tid(Convert.ToInt32(tid));
                        //版权信息判断
                        Copyright_Judge copyright_judge = new Copyright_Judge();
                        copyrightstr = copyright_judge.Copyright(Convert.ToInt32(copyright));
                        //SendDiscussMessage
                        e.FromDiscuss.SendDiscussMessage(title + "[共" + videos + "P]" + "\n" + "bv号:" + bvid + "\n" + "av号:" + av + "\n" + "UP主:" + name + "\nUP主UID:" + mid + "\n" + "-----------------\n" + tidstr + ":" + tname + "\n" + "点赞:" + like + "  投币:" + coin + "\n收藏:" + favorite + "  观看:" + view + "\n弹幕:" + danmaku + "  评论:" + reply + "\n分享:" + share + "\n-----------------\n" + "简介:" + desc);
                    }
                    else
                    {
                        e.FromDiscuss.SendDiscussMessage("错误:\n" + "Code:" + _Jsonobj.code + "\n" + _Jsonobj.Message + "\n" + "错误码:\n400为请求错误\n404为找不到稿件\n62002为稿件不可见");
                    }
                }
                else if (Msg.Substring(0, 2) == "bv")
                {
                    BiliBili_HttpGet_BV _HttpGet = new BiliBili_HttpGet_BV();
                    Json = _HttpGet.HttpGet(bvid = Msg.Substring(2, Msg.Length - 2));
                    var _Jsonobj = JsonConvert.DeserializeObject <dynamic>(Json);
                    if (_Jsonobj.code == 0)
                    {
                        //History_Write
                        File.AppendAllText(e.CQApi.AppDirectory + "HistorySearch.txt", e.FromDiscuss + "的" + e.FromQQ + "获取了" + Msg + "\n", Encoding.UTF8);
                        //Image_Download
                        //Image_Download imagedl = new Image_Download();
                        //pic = _Jsonobj.data.pic;
                        //imagedl.Image_DL(pic,pic.Substring(32,pic.Length-32));
                        //CQFunction cqimage = CQFunction.Image;
                        //Voluation_Json->String/Int[]
                        //data.
                        bvid      = _Jsonobj.data.bvid;         //bv号
                        av        = "av" + _Jsonobj.data.aid;   //av号
                        title     = _Jsonobj.data.title;        //标题
                        videos    = _Jsonobj.data.videos;       //分P数量
                        tid       = _Jsonobj.data.tid;          //主分区
                        tname     = _Jsonobj.data.tname;        //子分区
                        copyright = _Jsonobj.data.copyright;    //版权信息
                        pubdate   = _Jsonobj.data.pubdate;      //投稿时间(时间戳
                        desc      = _Jsonobj.data.desc;         //简介
                        duration  = _Jsonobj.data.duration;     //视频持续时长(所有分P
                        //data.owner.
                        mid  = _Jsonobj.data.owner.mid;         //up主UID
                        name = _Jsonobj.data.owner.name;        //up主昵称
                        face = _Jsonobj.data.owner.face;        //up主头像地址
                        //data.stat.
                        view     = _Jsonobj.data.stat.view;     //观看数量
                        danmaku  = _Jsonobj.data.stat.danmaku;  //弹幕数量
                        reply    = _Jsonobj.data.stat.reply;    //评论数量
                        favorite = _Jsonobj.data.stat.favorite; //收藏数量
                        coin     = _Jsonobj.data.stat.coin;     //投币数量
                        share    = _Jsonobj.data.stat.share;    //分享数量
                        like     = _Jsonobj.data.stat.like;     //获赞数量
                        //data.pages[].
                        //pages = new int[] { _Jsonobj.data.pages };
                        //data.pages[0/1/2].
                        //if (videos != "0")
                        {
                            //目前不处理
                        }
                        //data.staff[].
                        //staff = new int[] { _Jsonobj.data.staff };
                        //data.staff[0/1/2].
                        //if( staff.Length != 1)
                        {
                            //目前不处理
                        }
                        //时间戳转换
                        Pubdate_Convert pubdate_Convert = new Pubdate_Convert();
                        datetime = pubdate_Convert.Pubdate(pubdate);
                        //主分区转换
                        Tid_Judge tid_judge = new Tid_Judge();
                        tidstr = tid_judge.Tid(Convert.ToInt32(tid));
                        //版权信息判断
                        Copyright_Judge copyright_judge = new Copyright_Judge();
                        copyrightstr = copyright_judge.Copyright(Convert.ToInt32(copyright));
                        //SendDiscussMessage
                        e.FromDiscuss.SendDiscussMessage(title + "[共" + videos + "P]" + "\n" + "bv号:" + bvid + "\n" + "av号:" + av + "\n" + "UP主:" + name + "\nUP主UID:" + mid + "\n" + "-----------------\n" + tidstr + ":" + tname + "\n" + "点赞:" + like + "  投币:" + coin + "\n收藏:" + favorite + "  观看:" + view + "\n弹幕:" + danmaku + "  评论:" + reply + "\n分享:" + share + "\n-----------------\n" + "简介:" + desc);
                    }
                    else
                    {
                        e.FromDiscuss.SendDiscussMessage("错误:\n" + "Code:" + _Jsonobj.code + "\n" + _Jsonobj.Message + "\n" + "错误码:\n400为请求错误\n404为找不到稿件\n62002为稿件不可见");
                    }
                }
            }
            e.Handler = true;//MsgEnd
        }