File tree 3 files changed +11
-15
lines changed
3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -73,13 +73,11 @@ export async function ComponentHandler(interaction: MessageComponentInteraction)
73
73
Logger . error ( error . code || '' , error . message ) ;
74
74
if ( error . stack ) Logger . trace ( error . stack ) ;
75
75
const errorReply = ( ) =>
76
- ctx . replied || ctx . deferred
77
- ? ctx . editReply ( client . responses . ERROR )
78
- : ctx . reply ( {
79
- content : client . responses . ERROR ,
80
- ephemeral : true ,
81
- components : [ ] ,
82
- } ) ;
76
+ ctx . safeReply ( {
77
+ content : client . responses . ERROR ,
78
+ ephemeral : true ,
79
+ components : [ ] ,
80
+ } ) ;
83
81
if ( typeof component . onError === 'function' )
84
82
await Promise . resolve ( component . onError ( ctx , error ) ) . catch ( async ( ) => await errorReply ( ) ) ;
85
83
else await errorReply ( ) ;
Original file line number Diff line number Diff line change @@ -64,13 +64,11 @@ export async function InteractionCommandHandler(interaction: CommandInteraction
64
64
Logger . error ( error . code || '' , error . message ) ;
65
65
if ( error . stack ) Logger . trace ( error . stack ) ;
66
66
const errorReply = ( ) =>
67
- ctx . replied || ctx . deferred
68
- ? ctx . editReply ( client . responses . ERROR )
69
- : ctx . reply ( {
70
- content : client . responses . ERROR ,
71
- components : [ ] ,
72
- ephemeral : true ,
73
- } ) ;
67
+ ctx . safeReply ( {
68
+ content : client . responses . ERROR ,
69
+ components : [ ] ,
70
+ ephemeral : true ,
71
+ } ) ;
74
72
75
73
if ( typeof command . onError === 'function' )
76
74
await Promise . resolve ( command . onError ( ctx , error ) ) . catch ( async ( ) => await errorReply ( ) ) ;
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ export async function MessageCommandHandler(
95
95
Logger . error ( error . code || '' , error . message ) ;
96
96
if ( error . stack ) Logger . trace ( error . stack ) ;
97
97
const errorReply = ( ) =>
98
- ctx . reply ( {
98
+ ctx . safeReply ( {
99
99
content : client . responses . ERROR ,
100
100
components : [ ] ,
101
101
} ) ;
You can’t perform that action at this time.
0 commit comments