mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
fix webhook
This commit is contained in:
parent
21bfe3da7c
commit
db6d1b3ba9
2 changed files with 10 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue