Skip to content

Commit 466b477

Browse files
committed
fix: using __reply function
1 parent dff87e4 commit 466b477

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/structures/Interaction.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
} from 'discord-api-types/v10';
3939
import { mix } from 'ts-mixer';
4040
import type { RawFile } from '../api';
41-
import { ActionRow, Embed, Modal, resolveAttachment } from '../builders';
41+
import { ActionRow, Embed, Modal, resolveAttachment, resolveFiles } from '../builders';
4242
import { OptionResolver, type ContextOptionsResolved, type UsingClient } from '../commands';
4343
import type { ObjectToLower, OmitInsert, ToClass, When } from '../common';
4444
import type {
@@ -170,8 +170,19 @@ export class BaseInteraction<
170170
} as T;
171171
}
172172

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)));
175186
}
176187

177188
async reply(body: ReplyInteractionBody) {

0 commit comments

Comments
 (0)