Skip to content

Commit

Permalink
remove data of guilds that the bot is removed from
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Mar 12, 2021
1 parent 1312a8e commit e93ad31
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/features/guildDelete/deleteConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class DeleteConfig {
static async event(options, guild) {
await this.delete(options.database, guild.id);
}

static async delete(database, guildID) {
return Promise.all([
database.query("DELETE FROM channels WHERE guildid = ?",[guildID]),
database.query("DELETE FROM guilds WHERE id = ?",[guildID]),
database.query("DELETE FROM responses WHERE guildid = ?",[guildID]),
database.query("DELETE FROM badWords WHERE guildid = ?",[guildID]),
database.query("DELETE FROM moderations WHERE guildid = ?",[guildID])
]);
}
}

module.exports = DeleteConfig;

0 comments on commit e93ad31

Please sign in to comment.