mirror of
https://github.com/danbulant/discord.js
synced 2026-05-29 12:20:23 +00:00
feat(Webhook): addition of Webhook#avatarURL function (#3625)
* feat: addition of Webhook#avatarURL * typings: added Webhook#avatarURL * fix: trailing space * docs: fixed jsdoc function description * fix: typo
This commit is contained in:
parent
123713305a
commit
330d5db586
2 changed files with 11 additions and 0 deletions
|
|
@ -220,6 +220,16 @@ class Webhook {
|
|||
return this.client.options.http.api + this.client.api.webhooks(this.id, this.token);
|
||||
}
|
||||
|
||||
/**
|
||||
* A link to the webhook's avatar.
|
||||
* @param {ImageURLOptions} [options={}] Options for the Image URL
|
||||
* @returns {?string}
|
||||
*/
|
||||
avatarURL({ format, size } = {}) {
|
||||
if (!this.avatar) return null;
|
||||
return this.client.rest.cdn.Avatar(this.id, this.avatar, format, size);
|
||||
}
|
||||
|
||||
static applyToClass(structure) {
|
||||
for (const prop of [
|
||||
'send',
|
||||
|
|
|
|||
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
|
|
@ -1620,6 +1620,7 @@ declare module 'discord.js' {
|
|||
export class Webhook extends WebhookMixin() {
|
||||
constructor(client: Client, data?: object);
|
||||
public avatar: string;
|
||||
public avatarURL(options?: AvatarOptions): string | null;
|
||||
public channelID: Snowflake;
|
||||
public guildID: Snowflake;
|
||||
public name: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue