diff --git a/src/client/InteractionClient.js b/src/client/InteractionClient.js index c87790f4..39af1b2c 100644 --- a/src/client/InteractionClient.js +++ b/src/client/InteractionClient.js @@ -36,10 +36,15 @@ class InteractionClient extends BaseClient { */ constructor(options, handler, client) { super(options); - this.client = client || this; + this.handler = handler; this.token = options.token; this.publicKey = options.publicKey ? Buffer.from(options.publicKey, 'hex') : undefined; + this.clientId = options.clientId; + + // Compat for direct usage + this.client = client || this; + this.interactionClient = this; } getCommands(guildID) { diff --git a/src/structures/Interaction.js b/src/structures/Interaction.js index 0d6ea0a1..44f1fedf 100644 --- a/src/structures/Interaction.js +++ b/src/structures/Interaction.js @@ -99,7 +99,10 @@ class Interaction extends Base { const { data, files } = await apiMessage.resolveFiles(); - return this.client.api.webhooks(this.id, this.token).post({ + const clientId = this.client.interactionClient.clientId + || (await this.client.api.oauth2.applications('@me').get()).id; + + return this.client.api.webhooks(clientId, this.token).post({ auth: false, data, files,