diff --git a/src/modules/moderation.js b/src/modules/moderation.js index 79957d1..478f7c6 100644 --- a/src/modules/moderation.js +++ b/src/modules/moderation.js @@ -10,10 +10,20 @@ tidy.category = CATEGORY; tidy.helpText = "Clean up messages"; tidy.usage = "[subcommand] "; tidy.callback = async function (msg, line, [subcommand, count, extra]) { - if (!msg.channel.permissionsOf(msg.author.id).has("manageMessages")) { + const showHelp = !subcommand || subcommand === "" || subcommand === "help"; + if (!showHelp && !msg.guildID) { + return "Can only be used in guilds."; + } + if ( + !showHelp && + !msg.channel.permissionsOf(msg.author.id).has("manageMessages") + ) { return "You do not have `Manage Messages` permission."; } - if (!msg.channel.permissionsOf(hf.bot.user.id).has("manageMessages")) { + if ( + !showHelp && + !msg.channel.permissionsOf(hf.bot.user.id).has("manageMessages") + ) { return "I do not have `Manage Messages` permission."; } @@ -88,6 +98,7 @@ tidy.callback = async function (msg, line, [subcommand, count, extra]) { return `Deleted ${messages.length} message(s).`; } + case "help": default: return `__Usage__ • \`all \` - Last \`count\` messages.