Skip to content

Discord

timrademaker edited this page Oct 11, 2020 · 2 revisions

Sending Messages

sendMessage

Send a (plain) message to a Discord webhook.

Parameters

webhookUrl: The URL of your Discord webhook.

message: The content of the message.

sendEmbed

Send an embed to a Discord webhook.

Parameters

webhookUrl: The URL of your Discord webhook.

title: The title of the embed.

description (optional): The description of the embed.

color (optional): The color to use for the embed, represented by a decimal value. Examples: 3066993 (green), 15158332 (red), 16776960 (yellow).

fields (optional): Fields to include in the header, represented by an array of a two-string array (title and value). Example: [['Title', 'Value'], ['Title2', 'Value2']].

footer (optional): The embed's footer.

url (optional): The URL that the embed's title links to.

sendFile

Send one or more files to a Discord webhook.

Parameters

webhookUrl: The URL of your Discord webhook.

files: Either a Stringor a List of the path(s) of the file(s) to send.

message (optional): The content of the message.

Clone this wiki locally