private static int EventSystemGroupMemberIncrease(int subType, int sendTime, long fromGroup, long fromQQ, long beingOperateQQ) { GroupMemberAlterEventArgs args = new GroupMemberAlterEventArgs(); args.SendTime = NativeConvert.FotmatUnixTime(sendTime.ToString()); args.FromGroup = fromGroup; args.FromQQ = fromQQ; args.BeingOperateQQ = beingOperateQQ; args.Handled = false; if (subType == 1) // 管理员同意 { ReceiveMemberJoin(null, args); } else if (subType == 2) // 管理员邀请 { ReceiveMemberInvitee(null, args); } else { Common.CqApi.AddLoger(LogerLevel.Info, "Native提示", "EventSystemGroupMemberIncrease 方法发现新的消息类型"); } return((int)(args.Handled ? MessageHanding.Intercept : MessageHanding.Ignored)); //如果处理过就截断消息 }
private static int EventSystemGroupMemberDecrease(int subType, int sendTime, long fromGroup, long fromQQ, long beingOperateQQ) { GroupMemberAlterEventArgs args = new GroupMemberAlterEventArgs(); args.SendTime = sendTime.ToDateTime(); args.FromGroup = fromGroup; args.FromQQ = fromQQ; args.BeingOperateQQ = beingOperateQQ; args.Handled = false; if (subType == 1) // 群员离开 { args.FromQQ = beingOperateQQ; // 此时 FormQQ 为操作者QQ ReceiveMemberLeave(null, args); } else if (subType == 2) { ReceiveMemberRemove(null, args); } else { Common.CqApi.AddLoger(LogerLevel.Info, "Native提示", "EventSystemGroupMemberDecrease 方法发现新的消息类型"); } return((int)(args.Handled ? MessageHanding.Intercept : MessageHanding.Ignored)); //如果处理过就截断消息 }
/// <summary> /// Type=102 群事件 - 群成员减少 - 成员移除<para/> /// 处理收到的群成员减少 (成员移除) 事件 /// </summary> /// <param name="sender">事件的触发对象</param> /// <param name="e">事件的附加参数</param> public void ReceiveGroupMemberRemove(object sender, GroupMemberAlterEventArgs e) { // 本子程序会在酷Q【线程】中被调用, 请注意使用对象等需要初始化(ConIntialize, CoUninitialize). // 这里处理消息 e.Handled = false; // 关于返回说明, 请参见 "Event_FriendMessage.ReceiveFriendMessage" 方法 }
/// <summary> /// Type=102 群事件 - 群成员减少 - 成员离开<para/> /// 处理收到的群成员减少 (成员离开) 事件 /// </summary> /// <param name="sender">事件的触发对象</param> /// <param name="e">事件的附加参数</param> public void ReceiveGroupMemberLeave(object sender, GroupMemberAlterEventArgs e) { // 本子程序会在酷Q【线程】中被调用, 请注意使用对象等需要初始化(ConIntialize, CoUninitialize). // 这里处理消息 e.Handled = LuaEnv.LuaEnv.RunLua( $"fromqq={e.BeingOperateQQ} " + $"fromgroup={e.FromGroup}", "envent/ReceiveGroupMemberLeave.lua"); //e.Handled = false; // 关于返回说明, 请参见 "Event_FriendMessage.ReceiveFriendMessage" 方法 }
/// <summary> /// Type=103 群事件 - 群成员增加 - 被邀入群<para/> /// 处理收到的群成员增加 (被邀入群) 事件 /// </summary> /// <param name="sender">事件的触发对象</param> /// <param name="e">事件的附加参数</param> public void ReceiveGroupMemberInvitee(object sender, GroupMemberAlterEventArgs e) { // 本子程序会在酷Q【线程】中被调用, 请注意使用对象等需要初始化(ConIntialize, CoUninitialize). // 这里处理消息 e.Handled = LuaEnv.LuaEnv.RunLua( "", "envent/ReceiveGroupMemberJoin.lua", new ArrayList { "fromqq", e.BeingOperateQQ, "fromgroup", e.FromGroup }); //e.Handled = false; // 关于返回说明, 请参见 "Event_FriendMessage.ReceiveFriendMessage" 方法 }