diff --git a/src/structures/Message.js b/src/structures/Message.js index a83fd6935..8d43a1841 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -479,6 +479,15 @@ class Message { return this.client.rest.methods.sendMessage(this.channel, content, options); } + /** + * Fetches the webhook used to create this message. + * @returns {Promise} + */ + fetchWebhook() { + if (!this.webhookID) return Promise.reject(new Error('The message was not sent by a webhook.')); + return this.client.fetchWebhook(this.webhookID); + } + /** * Used mainly internally. Whether two messages are identical in properties. If you want to compare messages * without checking all the properties, use `message.id === message2.id`, which is much more efficient. This