File tree 3 files changed +20
-9
lines changed
3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ export const voiceOnDemandCommand = new SlashCommandBuilder()
4
4
. setName ( 'voice-on-demand' )
5
5
. setDescription ( 'Actions related to the voice lobby' )
6
6
. addSubcommand ( ( subcommand ) =>
7
- subcommand . setName ( 'create' ) . setDescription ( 'Creates the voice lobby' )
7
+ subcommand . setName ( 'create' ) . setDescription ( 'Creates the voice lobby' ) ,
8
8
)
9
9
. toJSON ( ) ;
10
+
11
+ export const fartCommand = new SlashCommandBuilder ( )
12
+ . setName ( 'fart' )
13
+ . setDescription ( "Replies with https://prout.dev" )
14
+ . toJSON ( ) ;
Original file line number Diff line number Diff line change @@ -7,15 +7,21 @@ export const handleInteractionCreation = async (interaction: Interaction): Promi
7
7
! interaction . isCommand ( ) ||
8
8
! interaction . inGuild ( ) ||
9
9
! interaction . isChatInputCommand ( ) ||
10
- interaction . commandName !== 'voice-on-demand'
10
+ ! [ 'voice-on-demand' , 'fart' ] . includes ( interaction . commandName )
11
11
) {
12
12
return ;
13
13
}
14
14
15
- if ( interaction . options . getSubcommand ( true ) !== 'create' ) {
16
- await interaction . reply ( 'Unknown subcommand' ) ;
17
- return ;
15
+ switch ( interaction . commandName ) {
16
+ case 'voice-on-demand' :
17
+ if ( interaction . options . getSubcommand ( true ) !== 'create' ) {
18
+ await interaction . reply ( 'Unknown subcommand' ) ;
19
+ return ;
20
+ }
21
+ await createLobby ( interaction ) ;
22
+ break ;
23
+ case 'fart' :
24
+ await interaction . reply ( 'https://prout.dev' ) ;
25
+ break ;
18
26
}
19
-
20
- await createLobby ( interaction ) ;
21
27
} ;
Original file line number Diff line number Diff line change 1
1
import { Client , REST , Routes } from 'discord.js' ;
2
2
3
- import { voiceOnDemandCommand } from './commands' ;
3
+ import { fartCommand , voiceOnDemandCommand } from './commands' ;
4
4
import { config } from './config' ;
5
5
import { deleteExistingCommands } from './delete-existing-commands' ;
6
6
import { handleGuildMessageCreation } from './handlers/handle-guild-message-creation' ;
@@ -51,7 +51,7 @@ const rest = new REST({ version: '10' }).setToken(discord.token);
51
51
await deleteExistingCommands ( rest , discord ) ;
52
52
53
53
await rest . put ( Routes . applicationGuildCommands ( discord . clientId , discord . guildId ) , {
54
- body : [ voiceOnDemandCommand ] ,
54
+ body : [ voiceOnDemandCommand , fartCommand ] ,
55
55
} ) ;
56
56
57
57
console . log ( 'Bot started.' ) ;
You can’t perform that action at this time.
0 commit comments