Fix deletion when no perms

This commit is contained in:
Christopher Cookman 2023-03-10 11:29:42 -07:00
parent e1a114ca45
commit ec44726013
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -136,7 +136,10 @@ client.on('messageCreate', async (message) => {
}
// If the session is processing, don't do anything
if (sessions[message.channelId].processing) {
// if the bot has perms attempt to delete the message
if (message.guild.me.permissions.has("MANAGE_MESSAGES")) {
message.delete();
}
return message.author.send(lang.busy).then((msg) => {
setTimeout(() => {
msg.delete();