1.4.0 • Published 2 years ago
fast-hook v1.4.0
Fast-Hook
Support Discord: https://discord.gg/support
This package creates an easy way to send webhooks, as well as providing fallbacks if the client does not have the proper permissions.
If the client does not have the permission Manage Webhooks
, it will send a normal message instead, causing no issues and working seamlessly
const send = require('fast-webhook');
Documentation
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
channel | textChannel | false | none | The channel to send the webhook to |
message | string or embed | false | none | The message or embed to send |
options | object | true | none | The options for the webhook |
options.name | string | true | Server Invite | The title of the webhook |
options.icon | iconURL | true | Webhook Icon | The icon of the webhook |
options.mentions | boolean | true | True | If false webhook will don't ping anyone. |
options.attachments | boolean | false | false | Status of adding attachments |
options.components | boolean | false | false | Status of adding components |
components | object | true | none | The components from Discord (buttons etc) |
attachments | object | true | none | The attachments (image etc) |
Examples
const send = require('fast-webhook');
send(message.channel, 'Current Settings...', {
name: 'Settings',
icon: 'https://i.imgur.com/X9eAmHm.png',
mentions: false,
attachments: false,
components: false
})
const Discord = require('discord.js');
const send = require('fast-webhook');
const embed = new Discord.MessageEmbed()
.setColor("#77C2AE")
.setTitle(`California`)
.setDescription(`**By *Clayton James***`)
.setFooter(`Just a normal embed!`);
send(message.channel, embed, {
name: 'Now Playing',
icon: 'https://i.imgur.com/44YTwve.png',
mentions: false,
attachments: false,
components: false
})
© DomeQ#0001 2018 || Edited by Derex#0002