diff --git a/src/structures/Webhook.js b/src/structures/Webhook.js index 472de07ea..1ad7cba93 100644 --- a/src/structures/Webhook.js +++ b/src/structures/Webhook.js @@ -213,6 +213,15 @@ class Webhook { return this.client.api.webhooks(this.id, this.token).delete({ reason }); } + /** + * The url of this webhook + * @type {string} + * @readonly + */ + get url() { + return this.client.options.http.api + this.client.api.webhooks(this.id, this.token); + } + static applyToClass(structure) { for (const prop of [ 'send', diff --git a/typings/index.d.ts b/typings/index.d.ts index f1547c876..53857b338 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1270,6 +1270,7 @@ declare module 'discord.js' { public guildID: Snowflake; public name: string; public owner: User | object; + public readonly url: string; } export class WebhookClient extends WebhookMixin(BaseClient) {