Ejemplo n.º 1
0
        /// <summary>
        /// 群成员增加事件
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        private Boolean Do_EventAddGroupMember(String json)
        {
            try
            {
                JObject jObject = JObject.Parse(json);

                GroupMemberAddEventArgs messageAddGroupMember = new GroupMemberAddEventArgs
                {
                    //.参数 from_wxid, 文本型, , 来源id,这里是群的id
                    //.参数 to_wxid, 文本型, , 对象id,你收到了群消息,这里是自己
                    //.参数 msg, 文本型, , { "inviter":"听风说雨(发出邀请人昵称)","inviter_wxid":"wxid_gdsdsgdhfd(发出邀请的人wxid)","inviter_cid":"sdfdsf(发出邀请的人标识id)","guest":"Stately(被邀请的人昵称)","guest_wxid":"wxid_gsdsdssd(被邀请的人wxid)","guest_cid":"SGDKHdsgdds(被邀请的人标识id)"}
                    From_wxid = jObject["from_wxid"].ToString(),
                    To_wxid   = jObject["to_wxid"].ToString(),
                    Msg       = jObject["msg"].ToString()
                };
                EventAddGroupMember?.Invoke(this, messageAddGroupMember);

                return(true);
            }
            catch (Exception ex)
            {
                DebugMessage(ex.Message);
                DebugMessage(ex.StackTrace);
                return(false);
            }
        }
Ejemplo n.º 2
0
        public string ToString(Newtonsoft.Json.Formatting formatting)
        {
            GroupMemberAddEventArgs classData = this;

            return(JsonConvert.SerializeObject(classData, formatting));
        }