@@ -38,7 +38,7 @@ import {
38
38
} from 'discord-api-types/v10' ;
39
39
import { mix } from 'ts-mixer' ;
40
40
import type { RawFile } from '../api' ;
41
- import { ActionRow , Embed , Modal , resolveAttachment } from '../builders' ;
41
+ import { ActionRow , Embed , Modal , resolveAttachment , resolveFiles } from '../builders' ;
42
42
import { OptionResolver , type ContextOptionsResolved , type UsingClient } from '../commands' ;
43
43
import type { ObjectToLower , OmitInsert , ToClass , When } from '../common' ;
44
44
import type {
@@ -170,8 +170,19 @@ export class BaseInteraction<
170
170
} as T ;
171
171
}
172
172
173
- private matchReplied ( data : ReplyInteractionBody ) {
174
- return ( this . replied = this . client . interactions . reply ( this . id , this . token , data ) . then ( ( ) => ( this . replied = true ) ) ) ;
173
+ private async matchReplied ( body : ReplyInteractionBody ) {
174
+ if ( this . __reply ) {
175
+ //@ts -expect-error
176
+ const { files, ...data } = body . data ?? { } ;
177
+ return this . __reply ( {
178
+ body : {
179
+ type : body . type ,
180
+ data,
181
+ } ,
182
+ files : files ? await resolveFiles ( files ) : undefined ,
183
+ } ) ;
184
+ }
185
+ return ( this . replied = this . client . interactions . reply ( this . id , this . token , body ) . then ( ( ) => ( this . replied = true ) ) ) ;
175
186
}
176
187
177
188
async reply ( body : ReplyInteractionBody ) {
0 commit comments