File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed
Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 33 StringSelectMenuBuilder,
44 StringSelectMenuOptionBuilder,
55 SlashCommandBuilder,
6+ DiscordjsError,
67 hyperlink,
78 hideLinkEmbed,
89} = require ( "discord.js" ) ;
@@ -134,12 +135,25 @@ module.exports = {
134135 content : `${ preamble } ${ link } ` ,
135136 } ) ;
136137 } catch ( error ) {
137- logger . error ( `Unable to send wiki link: ${ error } ` ) ;
138- await replyOrEditReply ( interaction , {
139- content : `Unable to send wiki link: ${ error } ` ,
140- components : [ ] ,
141- ephemeral : true ,
142- } ) ;
138+ // Errors from the user not responding to the dropdown in time don't log,
139+ // they're just too noisy.
140+ if (
141+ error instanceof DiscordjsError &&
142+ error . code === "InteractionCollectorError"
143+ ) {
144+ await replyOrEditReply ( interaction , {
145+ content : `No response received, canceling sending the wiki link` ,
146+ components : [ ] ,
147+ ephemeral : true ,
148+ } ) ;
149+ } else {
150+ logger . error ( `Unable to send wiki link: ${ error } ` , error ) ;
151+ await replyOrEditReply ( interaction , {
152+ content : `Unable to send wiki link: ${ error } ` ,
153+ components : [ ] ,
154+ ephemeral : true ,
155+ } ) ;
156+ }
143157 }
144158 } ,
145159} ;
You can’t perform that action at this time.
0 commit comments