Beispiel #1
0
 public void Update(XQGroup group)
 {
     this.Group = group;
     if (DateTime.Now - this.LastUpdateDate > TimeSpan.FromHours(1))
     {
         var groupmemberstr = group.GetGroupMemberList_B(this.RobotQQ);
         var groupmember    = JsonSerializer.Deserialize <XQMembers>(groupmemberstr);
         this.Owner        = groupmember.owner.ToString();
         this.GroupMembers = new List <GroupMember>();
         foreach (var qid in groupmember.members.Keys)
         {
             GroupMember _mb = new GroupMember()
             {
                 QQ = qid
             };
             var xqmb = groupmember.members[qid];
             _mb.NickName      = xqmb.nk;
             _mb.GroupNickName = xqmb.cd;
             if (string.IsNullOrEmpty(_mb.GroupNickName))
             {
                 _mb.GroupNickName = _mb.NickName;
             }
             if (this.Owner == qid)
             {
                 _mb.IsOwner = true;
             }
             _mb.LastMessageDate = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1), TimeZoneInfo.FindSystemTimeZoneById("China Standard Time"));
             _mb.LastMessageDate.AddSeconds(xqmb.lst);
             this.GroupMembers.Add(_mb);
         }
     }
 }
 public XQAppGroupMsgEventArgs(string robotQQ, int eventtype, int extratype, string fromGroup, string content)
 {
     RobotQQ   = robotQQ;
     EventType = eventtype;
     ExtraType = extratype;
     FromGroup = new XQGroup()
     {
         GroupId = fromGroup
     };
     Content = content;
 }
Beispiel #3
0
 public XQAppGroupMsgEventArgs(string robotQQ, int eventtype, int extratype, string fromGroup, string fromQQ, string msg, string index, string id, XQAPI api) : base(api)
 {
     RobotQQ   = robotQQ;
     EventType = eventtype;
     ExtraType = extratype;
     FromQQ    = new XQQQ(fromQQ, api);
     FromGroup = new XQGroup(fromGroup, api);
     Message   = new XQMessage()
     {
         Text = msg, MsdId = id, MsgIndex = index
     };
 }
Beispiel #4
0
        public static GroupClient GetClient(XQGroup client, string robot_qq)
        {
            if (GroupClients.ContainsKey(client.Id))
            {
                return(GroupClients[client.Id]);
            }

            var GroupClient = new GroupClient()
            {
                Group   = client,
                RobotQQ = robot_qq
            };

            GroupClients.Add(client.Id, GroupClient);
            return(GroupClient);
        }
Beispiel #5
0
 public XQAddGroupEventArgs(XQAPI api, string robotqq, int eventtype, string qq, string group, string seq) : base(api, robotqq, eventtype)
 {
     FromQQ    = new XQQQ(qq, api);
     FromGroup = new XQGroup(group, api);
     Seq       = seq;
 }
Beispiel #6
0
 /// <summary>
 /// 撤回消息
 /// </summary>
 /// <param name="robotQQ"></param>
 /// <param name="group">XQGroup实体</param>
 public void Withdraw(string robotQQ, XQGroup group)
 {
     XQAPI.WithdrawMsg(robotQQ, group.Id, MsgIndex, MsdId);
 }
Beispiel #7
0
 public XQMessage(string text, string msgIndex, string msdId, XQGroup fromGroup)
 {
     Text     = text;
     MsgIndex = msgIndex;
     MsdId    = msdId;
 }
Beispiel #8
0
 public XQBanSpeakEventArgs(XQAPI xqapi, string robotQQ, int eventType, string fromqq, string targetqq, string fromgroup) : base(xqapi, robotQQ, eventType)
 {
     FromQQ    = new XQQQ(fromqq, xqapi);
     FromGroup = new XQGroup(fromgroup, xqapi);
     TargetQQ  = new XQQQ(fromqq, xqapi);
 }
Beispiel #9
0
 /// <summary>
 /// 发送群消息
 /// </summary>
 /// <param name="groupid"></param>
 /// <param name="msg"></param>
 public void SendGroupMessage(XQGroup group, string msg)
 {
     group.SendMessage(RobotQQ, msg);
 }