From 4056c4ac0bc5764d2dae9e4ddcbadccc8fcb00a6 Mon Sep 17 00:00:00 2001 From: Alyxia Sother Date: Fri, 29 Oct 2021 15:44:03 +0200 Subject: [PATCH] Fixed some miscellaneous errors --- src/commands/utility/purge.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/utility/purge.ts b/src/commands/utility/purge.ts index 5c55551..a513b5c 100644 --- a/src/commands/utility/purge.ts +++ b/src/commands/utility/purge.ts @@ -16,14 +16,14 @@ export default new NamedCommand({ } } } else if (hasPermission(author, member, PERMISSIONS.BOT_SUPPORT)) { - if (guild!.me?.hasPermission(Permissions.FLAGS.MANAGE_MESSAGES)) message.delete(); + if (guild!.me?.permissions.has(Permissions.FLAGS.MANAGE_MESSAGES)) message.delete(); const messages = await channel.messages.fetch({ limit: 100 }); const travMessages = messages.filter((msg) => msg.author.id === client.user!.id); - send(`Found ${travMessages.size} messages to delete.`).then((msg) => msg.delete({timeout: 5000})); + send(`Found ${travMessages.size} messages to delete.`).then((msg) => setTimeout(() => msg.delete(), 5000)); // It's better to go through the bot's own messages instead of calling bulkDelete which requires MANAGE_MESSAGES. for (const message of messages.values()) {