3.0.2 • Published 2 years ago

discord-hook v3.0.2

Weekly downloads
19
License
MIT
Repository
-
Last release
2 years ago

Instructions

Info

Things with [] next to them means an array of that thing.

const Webhook = require("discord-hook"),
      webhook = new Webhook("https://discord.com/api/webhooks/.....", { 
          username: "The username of the webhook", 
          avatar_url: "The avatar/icon of the webhook" 
    });
      webhook
      .embeds(EMBED_DATA[])
      .embed(EMBED_DATA) // Look below for the EMBED_DATA information
      .content(`The content of the message`)
      .mention(`<@USERID>`) // or <@&ROLEID>
      .avatar(`The username of the webhook`, `The avatar/icon of the webhook`)
      .send(); // This returns the message object from the webhook being sent

Edit webhook messages

const webhook = new (require("discord-hook"))("https://discord.com/api/webhooks/....");

    webhook
      .embeds(EMBED_DATA[])
      .embed(EMBED_DATA) // Look below for the EMBED_DATA information
      .content(`The content of the message`)
      .mention(`<@USERID>`) // or <@&ROLEID>
      .avatar(`The username of the webhook`, `The avatar/icon of the webhook`)
      .edit(`MESSAGE_ID`);
    // This edits the webhook message in the channel, 
    // NOTE: The webhook url needs to be the webhook that created the message. 
Helper Method(s)
Method: .helpers.blank
Description: That provides a blank character "\u200b"

Method: .field(name, value, inline)
Description: Returns the {name: "", value: "", inline: false} object

Embed Data

{
    "title": "",
    "description": "",
    "color": "",
    "timestamp": new Date(),
    "url": "",
    "author": {
        "name": "",
        "icon_url": "",
        "url": ""
    },
    "footer": {
        "text": "",
        "icon_url": ""
    },
    "fields": [
        {
            "name": "",
            "value": "",
            "inline": true // or false
        }
    ]
}
3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago