mirror of
https://github.com/danbulant/discord.js
synced 2026-07-07 12:11:11 +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) {
|
constructor(options, handler, client) {
|
||||||
super(options);
|
super(options);
|
||||||
this.client = client || this;
|
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
this.token = options.token;
|
this.token = options.token;
|
||||||
this.publicKey = options.publicKey ? Buffer.from(options.publicKey, 'hex') : undefined;
|
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) {
|
getCommands(guildID) {
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,10 @@ class Interaction extends Base {
|
||||||
|
|
||||||
const { data, files } = await apiMessage.resolveFiles();
|
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,
|
auth: false,
|
||||||
data,
|
data,
|
||||||
files,
|
files,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue