Class: Webhook
Hierarchy
-
Base
↳Webhook
Table of contents
Constructors
Properties
Methods
- avatarURL
- createClient
- createdAt
- createdTimestamp
- isApplicationCreated
- isChannelFollower
- isIncoming
- isUserCreated
Constructors
constructor
• new Webhook(client
, data
): Webhook
Initializes a new instance of the class.
Parameters
Name | Type | Description |
---|---|---|
client | YorClient | The client instance. |
data | APIWebhook | The webhook data. |
Returns
Webhook
Overrides
Base.constructorDefined in
src/structures/Webhook.ts:27Properties
avatar
•Optional
avatar: string
Defined in
src/structures/Webhook.ts:18client
• client:YorClient
Inherited from
Base.clientDefined in
src/structures/Base.ts:4creator
•Optional
creator: User
Defined in
src/structures/Webhook.ts:19id
• id:string
Defined in
src/structures/Webhook.ts:15raw
•Readonly
raw: APIWebhook
Defined in
src/structures/Webhook.ts:13token
•Optional
token: string
Defined in
src/structures/Webhook.ts:17type
• type:WebhookType
Defined in
src/structures/Webhook.ts:16Methods
avatarURL
▸ avatarURL(options?
): undefined
| string
Returns the URL of the avatar image for this user.
Parameters
Name | Type | Description |
---|---|---|
options? | ImageURLOptions | Optional parameters for the image URL. |
Returns
undefined
| string
The URL of the avatar image, or undefined if there is no avatar.
Defined in
src/structures/Webhook.ts:80createClient
▸ createClient():false
| WebhookClient
<{ id
: string
; token
: string
}>
Creates a client if the call is incoming and returns a new WebhookClient instance.
Returns
false
| WebhookClient
<{ id
: string
; token
: string
}>
A new WebhookClient instance.
Defined in
src/structures/Webhook.ts:44createdAt
▸ createdAt():Date
Returns the creation date of the object.
Returns
Date
The creation date of the object.
Defined in
src/structures/Webhook.ts:70createdTimestamp
▸ createdTimestamp():number
Returns the created timestamp as a Date object.
Returns
number
The created timestamp.
Defined in
src/structures/Webhook.ts:56isApplicationCreated
▸ isApplicationCreated():boolean
Whether this webhook is created by an application.
Returns
boolean
Defined in
src/structures/Webhook.ts:102isChannelFollower
▸ isChannelFollower():boolean
Whether or not this webhook is a channel follower webhook.
Returns
boolean
Defined in
src/structures/Webhook.ts:110isIncoming
▸ isIncoming():boolean
Whether or not this webhook is an incoming webhook.
Returns
boolean
Defined in
src/structures/Webhook.ts:118isUserCreated
▸ isUserCreated():boolean
Whether this webhook is created by a user.
Returns
boolean