discohook.js
v1.1.0
Published
Build webhooks easily with discohook.js
Downloads
8
Maintainers
Readme
Webhook Builder
Sections
Installation
With NPM
$ npm install discohook.js
With yarn
$ yarn add discohook.js
Example
The example path is in the:
API
Webhook (Class)
Constructor:
- webhookURL: "String" | "URL"
Methods:
setWebhook
- data: "Object"
- username: "String"
- avatar_url: "String"
- data: "Object"
send
- content (optional): "String"
- embed (optional): "MessageBuilder"
(Content and embed parameters mustn't be null or empty)
EG:
// No. It's not gonna work
webhook.send(null, null);
// But this is valid
webhook.send(null, mb);
// And this
webhook.send("Hello World!");
Message Builder (Class)
Constructor:
- Embed Object: "Object"
Methods:
setTitle
- title: "String"
setURL
- titleURL: "String" | "URL"
setDescription
- description: "String"
setColor
- color: "String" | "Number"
setAuthor
- authorOpts: "Object"
- name: "String"
- icon_url (optional): "String" | "URL"
- url (optional): "String" | "URL"
- authorOpts: "Object"
setThumbnail
- url: "String" | "URL"
setField
- footerOpts: "Object[]"
- name: "String"
- value: "String"
- inline (optional): "Boolean"
- footerOpts: "Object[]"
setFooter - footerText: "String" - footerIcon (optional): "String" | "URL"