[Events] Restrict bot to configured guild. (#26)

This commit is contained in:
2026-11-10 07:51:53 -07:00
committed by GitHub
parent 6503a6ec11
commit 98b27043ce
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -126,6 +126,10 @@ client.on('interactionCreate', async (interaction) => {
client.on('clientReady', async () => {
console.log(`Logged in as ${client.user!.tag}!`);
for (const guild of client.guilds.cache.values()) {
if (guild.id != config.DISCORD_GUILD_ID) await guild.leave();
}
await loadHandlersFrom('commands', commands);
await loadHandlersFrom('context-menus', contextMenus);
await loadHandlersFrom('menus', menus);