@@ -157,8 +157,10 @@ export default class InteractionListener extends Listener {
157157 ) ;
158158 else if ( interaction . isButton ( ) )
159159 return await this . handleButton ( interaction ) ;
160- else if ( interaction . isSelectMenu ( ) )
161- return await this . handleSelect ( interaction ) ;
160+ else if ( interaction . isStringSelectMenu ( ) )
161+ return await this . handleStringSelect ( interaction ) ;
162+ else if ( interaction . isChannelSelectMenu ( ) )
163+ return await this . handleChannelSelect ( interaction ) ;
162164 else if ( interaction . isModalSubmit ( ) )
163165 return await this . handleModalSubmit ( interaction ) ;
164166 }
@@ -315,7 +317,8 @@ export default class InteractionListener extends Listener {
315317 }
316318 }
317319
318- async handleSelect ( select : MessageComponentInteraction ) {
320+ async handleStringSelect ( select : MessageComponentInteraction ) {
321+ if ( ! select . isStringSelectMenu ( ) ) return ;
319322 try {
320323 // should be cached if in guild or fetch if dm channel
321324 await this . client . channels . fetch ( select . channelId ) . catch ( ( ) => { } ) ;
@@ -350,6 +353,42 @@ export default class InteractionListener extends Listener {
350353 }
351354 }
352355
356+ async handleChannelSelect ( select : MessageComponentInteraction ) {
357+ if ( ! select . isChannelSelectMenu ( ) ) return ;
358+ try {
359+ // should be cached if in guild or fetch if dm channel
360+ await this . client . channels . fetch ( select . channelId ) . catch ( ( ) => { } ) ;
361+ const message = new ComponentMessage ( this . client , select ) ;
362+ if ( ! message . customId . startsWith ( "!" ) ) await message . channel . ack ( ) ;
363+ else message . customId = message . customId . slice ( 1 ) ;
364+ this . client . emit ( "channelSelect" , message ) ;
365+ } catch ( error ) {
366+ await this . error ( select , error ) . catch ( ( ) => {
367+ select . reply (
368+ `${ this . client . util . useEmoji ( "error" ) } Something went wrong...`
369+ ) ;
370+ } ) ;
371+ if ( typeof this . client . sentry != "undefined" ) {
372+ const sentry = this . client . sentry ;
373+ sentry . captureException ( error , {
374+ extra : {
375+ button : JSONStringifyBigint ( select ) ,
376+ member : select . member
377+ ? select . member . toString ( )
378+ : select . user . toString ( ) ,
379+ channel_id : select . channelId ,
380+ guild_id : select . guildId ,
381+ env : process . env . NODE_ENV ,
382+ } ,
383+ user : {
384+ id : select . user . id ,
385+ username : select . user . toString ( ) ,
386+ } ,
387+ } ) ;
388+ }
389+ }
390+ }
391+
353392 async handleModalSubmit ( modal : ModalSubmitInteraction ) {
354393 try {
355394 // should be cached if in guild or fetch if dm channel
0 commit comments