feat(Message): prevent fetching an interaction webhook. (#6468)

This commit is contained in:
Francis Rivard
2021-08-23 16:18:49 +02:00
committed by GitHub
parent 70cc0295f8
commit f39b597e31
2 changed files with 2 additions and 0 deletions

View File

@@ -788,6 +788,7 @@ class Message extends Base {
*/
fetchWebhook() {
if (!this.webhookId) return Promise.reject(new Error('WEBHOOK_MESSAGE'));
if (this.webhookId === this.applicationId) return Promise.reject(new Error('WEBHOOK_APPLICATION'));
return this.client.fetchWebhook(this.webhookId);
}