File tree 1 file changed +19
-0
lines changed
apps/test-bot/src/app/commands/(general)
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1
1
import CommandKit , {
2
+ ActionRow ,
2
3
Button ,
4
+ ChannelSelectMenu ,
3
5
ChatInputCommand ,
4
6
CommandData ,
5
7
Container ,
6
8
File ,
7
9
MediaGallery ,
8
10
MediaGalleryItem ,
11
+ OnChannelSelectMenuKitSubmit ,
9
12
Section ,
10
13
Separator ,
11
14
TextDisplay ,
@@ -31,6 +34,19 @@ const mediaItems: string[] = Array.from(
31
34
( _ , i ) => `https://cdn.discordapp.com/embed/avatars/${ i } .png` ,
32
35
) ;
33
36
37
+ const handleSelect : OnChannelSelectMenuKitSubmit = async (
38
+ interaction ,
39
+ context ,
40
+ ) => {
41
+ const selections = interaction . channels . map ( ( v ) => v . toString ( ) ) . join ( ', ' ) ;
42
+
43
+ await interaction . reply ( {
44
+ content : `You selected: ${ selections } ` ,
45
+ } ) ;
46
+
47
+ context . dispose ( ) ;
48
+ } ;
49
+
34
50
export const chatInput : ChatInputCommand = async ( ctx ) => {
35
51
const container = (
36
52
< Container accentColor = { Colors . Fuchsia } >
@@ -51,6 +67,9 @@ export const chatInput: ChatInputCommand = async (ctx) => {
51
67
< MediaGalleryItem description = "Gallery item description" url = { item } />
52
68
) ) }
53
69
</ MediaGallery >
70
+ < ActionRow >
71
+ < ChannelSelectMenu onSelect = { handleSelect } />
72
+ </ ActionRow >
54
73
</ Container >
55
74
) ;
56
75
You can’t perform that action at this time.
0 commit comments