Yor.ts | classes/Webhook
Class: Webhook
Hierarchy
-
↳
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
Overrides
Defined in
Properties
avatar
• Optional
avatar: string
Defined in
client
• client: YorClient
Inherited from
Defined in
creator
• Optional
creator: User
Defined in
id
• id: string
Defined in
raw
• Readonly
raw: APIWebhook
Defined in
token
• Optional
token: string
Defined in
type
• type: WebhookType
Defined in
Methods
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
createClient
▸ 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
createdAt
▸ createdAt(): Date
Returns the creation date of the object.
Returns
The creation date of the object.
Defined in
createdTimestamp
▸ createdTimestamp(): number
Returns the created timestamp as a Date object.
Returns
number
The created timestamp.
Defined in
isApplicationCreated
▸ isApplicationCreated(): boolean
Whether this webhook is created by an application.
Returns
boolean
Defined in
isChannelFollower
▸ isChannelFollower(): boolean
Whether or not this webhook is a channel follower webhook.
Returns
boolean
Defined in
isIncoming
▸ isIncoming(): boolean
Whether or not this webhook is an incoming webhook.
Returns
boolean
Defined in
isUserCreated
▸ isUserCreated(): boolean
Whether this webhook is created by a user.
Returns
boolean
Defined in
Was this page helpful?