Skip to content

Commit

Permalink
add environmental variable for default guild
Browse files Browse the repository at this point in the history
to enable slash commands
  • Loading branch information
Nathaniel Moschkin committed Oct 7, 2023
1 parent 7710e24 commit 7d9f564
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ client.on('ready', () => {
Logger.info(`Registering commands globally`);
client?.application?.commands.set(slashCommands);
} else {

if (!!process.env.DEFAULT_GUILD) {
const gid = process.env.DEFAULT_GUILD;
Logger.info(`Registering commands for guild ${gid}`);
client.guilds.cache.get(gid)?.commands.set(slashCommands);
}

for (const gid of devGuilds) {
Logger.info(`Registering commands for guild ${gid}`);
client.guilds.cache.get(gid)?.commands.set(slashCommands);
Expand Down

0 comments on commit 7d9f564

Please sign in to comment.