File tree Expand file tree Collapse file tree
apps/test-bot/src/app/commands/(general) Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import CommandKit , {
2+ ActionRow ,
23 Button ,
4+ ChannelSelectMenu ,
35 ChatInputCommand ,
46 CommandData ,
57 Container ,
68 File ,
79 MediaGallery ,
810 MediaGalleryItem ,
11+ OnChannelSelectMenuKitSubmit ,
912 Section ,
1013 Separator ,
1114 TextDisplay ,
@@ -31,6 +34,19 @@ const mediaItems: string[] = Array.from(
3134 ( _ , i ) => `https://cdn.discordapp.com/embed/avatars/${ i } .png` ,
3235) ;
3336
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+
3450export const chatInput : ChatInputCommand = async ( ctx ) => {
3551 const container = (
3652 < Container accentColor = { Colors . Fuchsia } >
@@ -51,6 +67,9 @@ export const chatInput: ChatInputCommand = async (ctx) => {
5167 < MediaGalleryItem description = "Gallery item description" url = { item } />
5268 ) ) }
5369 </ MediaGallery >
70+ < ActionRow >
71+ < ChannelSelectMenu onSelect = { handleSelect } />
72+ </ ActionRow >
5473 </ Container >
5574 ) ;
5675
You can’t perform that action at this time.
0 commit comments