Webhook

sendMessage


General

sendMessage is a method letting you send a message or embed to the channel with the webhook.


Usage

Webhook:sendMessage(<string> content, (array / Embed / Attachment) options)
Returns: <Message> message

You have to provide either content, attachment or embed. Blank message results in error.


Limitations

Upgrade Type Limit ( per 1s )
STANDARD (0) 30

 


Example

Webhook:sendMessage("Hello there!", Embed.new():addField("Test name", "Test value"))

edit


General

edit is a method which lets you edit your webhook's name and avatar.


Usage

Webhook:edit(<string> name, (string) avatarUrl)
Returns: <Webhook> webhook

Using non-URL string in avatar will result in error.


Limitations

Upgrade Type Limit ( per 1s )
STANDARD (0) 1

 


Example

Webhook:edit("Mark", "https://0q0.eu/img/okwo.png")

delete


General

delete is a method removing the webhook.


Usage

Webhook:delete(<string> reason)
Returns: <boolean> success

This action is irreversible!


Limitations

Upgrade Type Limit ( per 1s )
STANDARD (0) 1

 


Example

Webhook:delete("Webhook is no longer needed!")