1
1
import { REST , Routes } from 'discord.js' ;
2
2
import { AppCommand } from '../../commands/commands' ;
3
- import { BOT_TOKEN , ENV , GUILD_IDS , USE_DATABASE } from '../../config/environment' ;
3
+ import { BOT_ID , BOT_TOKEN , ENV , GUILD_IDS , USE_DATABASE } from '../../config/environment' ;
4
4
import { createGuildTable , populateGuilds } from '../../services/database' ;
5
5
import { sendBootNotification , sendErrorLog } from '../../utils/helpers' ;
6
6
import { EventModule } from '../events' ;
@@ -14,17 +14,15 @@ const registerApplicationCommands = async (commands?: AppCommand[]) => {
14
14
try {
15
15
if ( ENV === 'dev' ) {
16
16
if ( GUILD_IDS ) {
17
- //Registering guild-only commands to the bot; I like to use a different bot for dev purposes
18
- //TODO: Change id here to placeholder
19
- await rest . put ( Routes . applicationGuildCommands ( '929421200797626388' , GUILD_IDS ) , {
17
+ //Registering guild-only commands to the bot i.e. only specified servers will see commands; I like to use a different bot when in development
18
+ await rest . put ( Routes . applicationGuildCommands ( BOT_ID , GUILD_IDS ) , {
20
19
body : commandList ,
21
20
} ) ;
22
21
console . log ( 'Successfully registered guild application commands' ) ;
23
22
}
24
23
} else {
25
- //Registering global commands for the bot i.e. every guild will see the commands; I mostly just use this in production
26
- //TODO: Change id here to placeholder
27
- await rest . put ( Routes . applicationCommands ( '518196430104428579' ) , { body : commandList } ) ;
24
+ //Registering global commands for the bot i.e. every server bot is in will see commands; use this in production
25
+ await rest . put ( Routes . applicationCommands ( BOT_ID ) , { body : commandList } ) ;
28
26
console . log ( 'Successfully registered global application commands' ) ;
29
27
}
30
28
} catch ( error ) {
0 commit comments