File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -29,28 +29,25 @@ export default class CommandContext {
2929 opts : BaseMessageOptions | InteractionReplyOptions ,
3030 ) : Promise < unknown > {
3131 if ( this . interaction instanceof ChatInputCommandInteraction ) {
32+ const safeOptions = { ...opts } ;
33+ delete ( safeOptions as any ) . flags ;
34+
3235 if ( this . interaction . replied ) {
33- return this . interaction . followUp (
34- Object . assign ( opts , {
35- withResponse : true ,
36- } ) as InteractionReplyOptions ,
37- ) ;
36+ return this . interaction . followUp ( safeOptions as InteractionReplyOptions ) ;
3837 }
38+
3939 if ( this . interaction . deferred ) {
40- // @ts -ignore
41- return this . interaction . editReply (
42- Object . assign ( opts , {
43- withResponse : true ,
44- } ) as InteractionReplyOptions ,
45- ) ;
40+ return this . interaction . editReply ( safeOptions as InteractionEditReplyOptions ) ;
4641 }
47- return this . interaction . reply (
48- Object . assign ( opts , { withResponse : true } ) as InteractionReplyOptions ,
49- ) ;
42+
43+ return this . interaction . reply ( opts as InteractionReplyOptions ) ;
5044 }
45+
5146 if ( this . interaction instanceof Message ) {
5247 return this . interaction . reply ( opts as BaseMessageOptions ) ;
5348 }
49+
50+ return Promise . reject ( new Error ( "Unsupported interaction type" ) ) ;
5451 }
5552
5653 public get subCommand ( ) : string | boolean {
You can’t perform that action at this time.
0 commit comments