public static int ProcessJoinGroupRequest( int subType, int sendTime, long fromGroup, long fromQQ, string msg, string responseMark) { switch (subType) { case 1: // 管理员收到入群申请 PluginInstanceManager.GetInstance().SendCommand(new GroupJoiningRequestCommand { SendTime = ConvertToDatetime(sendTime), FromQq = fromQQ, ToGroup = fromGroup, Message = msg, GroupJoiningRequestId = responseMark, }); break; case 2: // 收到加群邀请 PluginInstanceManager.GetInstance().SendCommand(new GroupJoiningInvitationCommand { SendTime = ConvertToDatetime(sendTime), FromQq = fromQQ, ToGroup = fromGroup, Message = msg, GroupJoiningInvitationId = responseMark, }); break; default: break; } return(0); }
public static int ProcessGroupMemberDecrease( int subType, int sendTime, long fromGroup, long fromQQ, long target) { GroupMemberDecreasedReason reason; switch (subType) { case 1: reason = GroupMemberDecreasedReason.Leavebyself; break; case 2: reason = GroupMemberDecreasedReason.Kicked; break; case 3: reason = GroupMemberDecreasedReason.Kicked; break; default: reason = GroupMemberDecreasedReason.Unknow; break; } PluginInstanceManager.GetInstance().SendCommand(new GroupMemberDecreasedCommand { SendTime = ConvertToDatetime(sendTime), ToQq = target, FromGroup = fromGroup, FromQq = fromQQ, GroupMemberDecreasedReason = reason, }); return(0); }
public static int ProcessPrivateMessage(int subType, int msgId, long fromQQ, string msg, int font) { PrivateMessageFromType privateMessageFromType; switch (subType) { case 11: privateMessageFromType = PrivateMessageFromType.Friend; break; case 1: privateMessageFromType = PrivateMessageFromType.Online; break; case 2: privateMessageFromType = PrivateMessageFromType.Group; break; case 3: privateMessageFromType = PrivateMessageFromType.DiscussGroup; break; default: privateMessageFromType = PrivateMessageFromType.Unknown; break; } PluginInstanceManager.GetInstance().SendCommand(new PrivateMessageCommand { PrivateMessageFromType = privateMessageFromType, FormNum = fromQQ, Message = msg, SendTime = DateTime.Now, MessageId = msgId, }); return(0); }
public static int CoolQExited() { PluginInstanceManager.GetInstance().SendCommand(new CoolQExitedCommand()); return(0); }
public static string AppInfo() { var re = PluginInstanceManager.GetInstance().SendCommand <AppInfoCommand, AppInfoCommandResult>(new AppInfoCommand()); return($"{CoolApiVersion},{re.AppId}".ToLowerInvariant()); }
public static int Disabled() { PluginInstanceManager.GetInstance().SendCommand(new DisabledCommand()); return(0); }
public static int ProcessMenuClickA() { PluginInstanceManager.GetInstance().SendCommand(new ConfigurationManagerCommand()); return(0); }
public static int CoolQExited() { PluginInstanceManager.GetInstance().HandleMahuaOutput(new CoolQExited()); return(0); }
public static int Disabled() { PluginInstanceManager.GetInstance().HandleMahuaOutput(new Disabled()); return(0); }