From 3517547b43a5afa1269288179b223f1a66f89b1b Mon Sep 17 00:00:00 2001 From: Voltstro Date: Thu, 2 Jan 2020 01:27:38 +1000 Subject: [PATCH] Fixed a check for rule reaction Updated some message outputs for the command `setuprulesmessage` Updated the command `setuprulesmessage`'s summary --- src/Pootis-Bot/Events/ChannelEvents.cs | 3 +-- src/Pootis-Bot/Modules/Server/ServerSetup.cs | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Pootis-Bot/Events/ChannelEvents.cs b/src/Pootis-Bot/Events/ChannelEvents.cs index 348edd8e..6b4da7f2 100644 --- a/src/Pootis-Bot/Events/ChannelEvents.cs +++ b/src/Pootis-Bot/Events/ChannelEvents.cs @@ -23,8 +23,7 @@ public async Task ChannelDestroyed(SocketChannel channel) BotCheckServerSettings.CheckServerActiveVoiceChannels(server); //Check the bot's rule message channel - //TODO: When you delete a channel, even though its not the channel were the rule message is located, this will still be triggered and disable the rule reaction feature - //await BotCheckServerSettings.CheckServerRuleMessageChannel(server); + await BotCheckServerSettings.CheckServerRuleMessageChannel(server); } } } \ No newline at end of file diff --git a/src/Pootis-Bot/Modules/Server/ServerSetup.cs b/src/Pootis-Bot/Modules/Server/ServerSetup.cs index 7d90ef6a..2ff97804 100644 --- a/src/Pootis-Bot/Modules/Server/ServerSetup.cs +++ b/src/Pootis-Bot/Modules/Server/ServerSetup.cs @@ -158,7 +158,7 @@ await Context.Channel.SendMessageAsync( } [Command("setuprulesmessage")] - [Summary("Sets the rules message by the message id. Needs to be in the same channel with the message!")] + [Summary("Sets the message that needs to be reacted to. You need to run the command in the same channel were the message is located!")] [Alias("setup rules message")] [RequireGuildOwner] public async Task SetupRuleMessage(ulong id = 0) @@ -169,21 +169,22 @@ public async Task SetupRuleMessage(ulong id = 0) { ServerList server = ServerListsManager.GetServer(Context.Guild); server.RuleMessageId = id; + server.RuleMessageChannelId = Context.Channel.Id; ServerListsManager.SaveServerList(); await Context.Channel.SendMessageAsync( - $"The rule message was set to the message with the id of **{id}**."); + $"The rule message was set to the message with the ID of **{id}**."); } else { await Context.Channel.SendMessageAsync( - "That message doesn't exist! Make sure you are in the same channel as were that message is located."); + "Cannot find a message with that ID! Make sure you are in the same channel were the message is located."); } } else { - await Context.Channel.SendMessageAsync("The rules message was disabled"); + await Context.Channel.SendMessageAsync("The rules message was disabled."); ServerList server = ServerListsManager.GetServer(Context.Guild); server.RuleMessageId = 0;