Class: Webhook

Webhook(url)

new Webhook(url)

Parameters:
Name Type Description
url string The webhooks url.
Source:

Members

endpoint

Source:

Methods

checkFields(fields)

Checks every field in the only possible attachment.
Parameters:
Name Type Description
fields fields
Source:

checkFieldValueLength(value)

Check a fields value length, because discord is rejecting fields containing more than 1024 chararacters in a value.
Parameters:
Name Type Description
value string
Source:

custom(name, message, title, color, imageUrl)

Parameters:
Name Type Description
name string The username of the custom webhook.
message string The message of the custom webhook.
title string The title of the custom webhook.
color string The color of the custom webhook. (optional)
imageUrl string The url of the image to attach (optional)
Source:

err(name, message)

Parameters:
Name Type Description
name string The username of the error webhook.
message string The message of the error webhook.
Source:

image(name, message, title, imageUrl)

Parameters:
Name Type Description
name string The username of the webhook
message string The message for the webhook to send
title string The title of the message
imageUrl string The URL of the image to attach
Source:

info(name, message)

Parameters:
Name Type Description
name string The username of the info webhook.
message string The message of the info webhook.
Source:

sanitiseEmbeds(data)

Remove embeds from a message if only text is specified
Parameters:
Name Type Description
data Object The Discord webhook data
Source:

send(messageBuilder)

This method is used to send a MessageBuilder to the webhook.
Parameters:
Name Type Description
messageBuilder MessageBuilder The message.
Source:

sendPayload(payloadRaw, resolveFunction)

Parameters:
Name Type Description
payloadRaw object The payload to send.
resolveFunction function Used internally for ratelimiting handling
Source:

success(name, message)

Parameters:
Name Type Description
name string The username of the success webhook.
message string The message of the success webhook.
Source:

verifyName(name)

Verify the name of a webhook.
Parameters:
Name Type Description
name string The name of the webhook
Source:

warn(name, message)

Parameters:
Name Type Description
name string The username of the warning webhook.
message string The message of the warning webhook.
Source: