Added messageDelete event

This commit is contained in:
Christer Warén 2021-09-02 14:39:23 +03:00
parent 492df398ff
commit 1fd6c2c691
2 changed files with 14 additions and 0 deletions

View File

@ -52,6 +52,10 @@ class RadioClient extends Client {
require(`${events}messageCreate`).execute(this, msg); require(`${events}messageCreate`).execute(this, msg);
}); });
this.on("messageDelete", msg => {
require(`${events}messageDelete`).execute(this, msg);
});
this.on("interactionCreate", interaction => { this.on("interactionCreate", interaction => {
require(`${events}interactionCreate`).execute(this, interaction); require(`${events}interactionCreate`).execute(this, interaction);
}); });

View File

@ -0,0 +1,10 @@
module.exports = {
name: 'messageDelete',
async execute(client, msg) {
if (!msg.author.bot || !msg.guild) return;
const radio = client.radio.get(msg.guild.id);
if (!radio) return;
if(msg.id != radio.message.id) return;
radio.message = null;
}
}