Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid sending bot auth on token endpoints #7022

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/structures/AutocompleteInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class AutocompleteInteraction extends Interaction {
choices: options,
},
},
auth: false,
});
this.responded = true;
}
Expand Down
6 changes: 5 additions & 1 deletion src/structures/Webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ class Webhook {
const data = await this.client.api.webhooks(this.id, channel ? undefined : this.token).patch({
data: { name, avatar, channel_id: channel },
reason,
auth: !this.token || Boolean(channel),
});

this.name = data.name;
Expand Down Expand Up @@ -287,6 +288,7 @@ class Webhook {
query: {
thread_id: cacheOrOptions.threadId,
},
auth: false,
});
return this.client.channels?.cache.get(data.channel_id)?.messages._add(data, cacheOrOptions.cache) ?? data;
}
Expand Down Expand Up @@ -317,6 +319,7 @@ class Webhook {
query: {
thread_id: messagePayload.options.threadId,
},
auth: false,
});

const messageManager = this.client.channels?.cache.get(d.channel_id)?.messages;
Expand All @@ -336,7 +339,7 @@ class Webhook {
* @returns {Promise<void>}
*/
async delete(reason) {
await this.client.api.webhooks(this.id, this.token).delete({ reason });
await this.client.api.webhooks(this.id, this.token).delete({ reason, auth: !this.token });
}

/**
Expand All @@ -355,6 +358,7 @@ class Webhook {
query: {
thread_id: threadId,
},
auth: false,
});
}

Expand Down
4 changes: 4 additions & 0 deletions src/structures/interfaces/InteractionResponses.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class InteractionResponses {
flags: options.ephemeral ? MessageFlags.FLAGS.EPHEMERAL : undefined,
},
},
auth: false,
});
this.deferred = true;

Expand Down Expand Up @@ -101,6 +102,7 @@ class InteractionResponses {
data,
},
files,
auth: false,
});
this.replied = true;

Expand Down Expand Up @@ -179,6 +181,7 @@ class InteractionResponses {
data: {
type: InteractionResponseTypes.DEFERRED_MESSAGE_UPDATE,
},
auth: false,
});
this.deferred = true;

Expand Down Expand Up @@ -213,6 +216,7 @@ class InteractionResponses {
data,
},
files,
auth: false,
});
this.replied = true;

Expand Down