From 02394e310d6009a468fa9bf1c5972f2ced907142 Mon Sep 17 00:00:00 2001 From: Noah Date: Wed, 17 Nov 2021 19:04:38 -0600 Subject: [PATCH] Exit if joins or leaves guild --- Events/guildCreate.js | 9 +++++++++ Events/guildDelete.js | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Events/guildCreate.js create mode 100644 Events/guildDelete.js diff --git a/Events/guildCreate.js b/Events/guildCreate.js new file mode 100644 index 0000000..16bd038 --- /dev/null +++ b/Events/guildCreate.js @@ -0,0 +1,9 @@ +const Event = require("../Structures/Event.js"); +module.exports = new Event("guildCreate", async (client) => { + console.log( + `\u001b[31m`, + `${client.user.username} is not in the correct server set in your config. Please leave all other servers and restart the bot.` + ); + console.log(`\u001b[31m`, `${client.user.username} will now exit.`); + return process.exit(1); +}); diff --git a/Events/guildDelete.js b/Events/guildDelete.js new file mode 100644 index 0000000..d3cfbd2 --- /dev/null +++ b/Events/guildDelete.js @@ -0,0 +1,10 @@ +const Event = require("../Structures/Event.js"); + +module.exports = new Event("guildDelete", async (client) => { + console.log( + `\u001b[31m`, + `${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.` + ); + console.log(`\u001b[31m`, `${client.user.username} will now exit.`); + return process.exit(1); +});