discord-webhook-multi v1.0.8
Discord-Webhook-Multi
Make a webhook with up to 10 embeds in a single request
Installation
npm install discord-webhook-mutli
Usage
const { Webhook, MessageBuilder } = require('discord-webhook-mutli');
var hook = new Webhook('Webhook URI Here');
for(var i = 0; i < 10; ++i){ // Loop 10 times
var embed = new MessageBuilder(); // Make a new Embed
embed.setTitle(`Embeds: ${i}`) // Set the Title
.addField('Multiply', 10*i, true) // add a new inline field
.addField('Divide', 10/i, true) // add a new inline field
.addField('Bananas', `I Have ${2*i} Bananas`) // add a new field
.setColour('#42f5ce') // Supports Hex Colours
.setTimestamp();
hook.addEmbed(embed); // Add the embed to the webhook
}
hook.Post(); // Post them all
Documentation
Webhook.setUsername('string')
Set the username of the Webhook, bypassing what was set inside discord itselfWebhook.setAvatar('imageURL')
Set the avatar of the Webhook, bypassing what was set inside discord itselfWebhook.addEmbed(embed)
Add a new embed to the webhookWebhook.clearEmbeds()
remove all the embeds currently in the webhookWebhook.getLength()
Get the current amount of embeds in the webhookWebhook.Post()
Post the Webhook to DiscordMessageBuilder.setAuthor('string', 'imageURL', 'URL')
Set the Author of the Embed, you can also set the image and urlMessageBuilder.setTitle('string')
Set the title of the EmbedMessageBuilder.setURL('url')
Set the url of the Embed, makes the title a hyperlinkMessageBuilder.setThumbnail('imageURL')
Set the thumbnail of the EmbedMessageBuilder.setTimestamp()
Set the current time as the timestamp of the embedMessageBuilder.setColour('hexColour')
Set the colour of the embed using Hex Colour codes (eg, #FFFFFF)MessageBuilder.setDescription('string')
Set the thumbnail of the EmbedMessageBuilder.setFooter('string', 'imageURL')
Set the footer of the embed, including an iconMessageBuilder.addField('string', 'string' , boolean)
Add a field to the embed with a title and a value, optionally make the field inline with a boolean
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.