private void OnGotPM(object sender, BasicCommunication.MessageParser.Got_PM_EventArgs e) { string Message = e.Message; if (Message[0] != '#') { Message = "#" + Message; } string[] CommandArray = Message.Split(' '); if (CommandArray[0].ToLower() == "#kickme") { bool disabled = TheMySqlManager.CheckIfCommandIsDisabled("#kickme", Settings.botid); if (disabled == true) { TheTCPWrapper.Send(CommandCreator.SEND_PM(e.username, "This command is disabled")); return; } if (TheMySqlManager.GetUserRank(e.username, Settings.botid) < TheMySqlManager.GetCommandRank("#kickme", Settings.botid)) { TheTCPWrapper.Send(CommandCreator.SEND_PM(e.username, "You are not authorized to use this command!")); return; } if (TheMySqlManager.CheckIfGuildMember(e.username, Settings.botid) == false) { TheTCPWrapper.Send(CommandCreator.SEND_PM(e.username, "Sorry, but you are not a guild member.")); return; } Message = "#remove " + e.username; TheTCPWrapper.Send(CommandCreator.RAW_TEXT(Message)); } return; }
private void OnGotPM(object sender, BasicCommunication.MessageParser.Got_PM_EventArgs e) { string Message = e.Message; if (Message[0] != '#') { Message = "#" + Message; } string[] CommandArray = Message.Split(' '); if (CommandArray[0].ToLower() == "#acceptme") { bool disabled = TheMySqlManager.CheckIfCommandIsDisabled("#acceptme", Settings.botid); if (disabled == true) { TheTCPWrapper.Send(CommandCreator.SEND_PM(e.username, "This command is disabled")); return; } if (TheMySqlManager.GetUserRank(e.username, Settings.botid) < TheMySqlManager.GetCommandRank("#acceptme", Settings.botid)) { TheTCPWrapper.Send(CommandCreator.SEND_PM(e.username, "You are not authorized to use this command!")); return; } if (TheMySqlManager.CheckIfGuildMember(e.username, Settings.botid) == false) { TheTCPWrapper.Send(CommandCreator.SEND_PM(e.username, "Sorry, but you are not a guild member.")); return; } TheTCPWrapper.Send(CommandCreator.SEND_PM(e.username, "If you don't get accepted check if you have typed in #join_guild " + TheMySqlManager.guildlongname(Settings.botid) + " before using this command.")); TheTCPWrapper.Send(CommandCreator.RAW_TEXT("#accept " + e.username)); } return; }