1.4.0 • Published 2 years ago

fast-hook v1.4.0

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

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

ParameterTypeOptionalDefaultDescription
channeltextChannelfalsenoneThe channel to send the webhook to
messagestring or embedfalsenoneThe message or embed to send
optionsobjecttruenoneThe options for the webhook
options.namestringtrueServer InviteThe title of the webhook
options.iconiconURLtrueWebhook IconThe icon of the webhook
options.mentionsbooleantrueTrueIf false webhook will don't ping anyone.
options.attachmentsbooleanfalsefalseStatus of adding attachments
options.componentsbooleanfalsefalseStatus of adding components
componentsobjecttruenoneThe components from Discord (buttons etc)
attachmentsobjecttruenoneThe attachments (image etc)

Examples

npm.io

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
})

npm.io

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