mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 12:40:50 +00:00
feat(Webhook): add url getter (#3178)
* add Webhook#url * set typing as readonly * suggested change * another one
This commit is contained in:
parent
bb92289e45
commit
c078682722
2 changed files with 10 additions and 0 deletions
|
|
@ -213,6 +213,15 @@ class Webhook {
|
||||||
return this.client.api.webhooks(this.id, this.token).delete({ reason });
|
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) {
|
static applyToClass(structure) {
|
||||||
for (const prop of [
|
for (const prop of [
|
||||||
'send',
|
'send',
|
||||||
|
|
|
||||||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
|
|
@ -1270,6 +1270,7 @@ declare module 'discord.js' {
|
||||||
public guildID: Snowflake;
|
public guildID: Snowflake;
|
||||||
public name: string;
|
public name: string;
|
||||||
public owner: User | object;
|
public owner: User | object;
|
||||||
|
public readonly url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WebhookClient extends WebhookMixin(BaseClient) {
|
export class WebhookClient extends WebhookMixin(BaseClient) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue