Fixed some miscellaneous errors

This commit is contained in:
Alyxia Sother 2021-10-29 15:44:03 +02:00
parent 203c541025
commit 4056c4ac0b
No known key found for this signature in database
GPG Key ID: 355968D14144B739
1 changed files with 2 additions and 2 deletions

View File

@ -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()) {