1.0.0 • Published 2 years ago

fast-hooks v1.0.0

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

Fast-Hook

Support Discord: soon (Dar3k#1121)


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-hook');

Documentation

ParameterTypeOptionalDefaultDescription
optionsobjecttruenoneThe options for the webhook
options.channeltextChannelfalsenoneChannel to send webhook
options.messagemessagetruenoneMessage to send with 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.attachmentsobjecttruenullObject with attachments
options.componentsobjecttruenullObject with components
options.embedobjecttruenullObject with embeds

Examples

npm.io

const send = require('fast-hook');


send({
    channel: message.channel,
    message: 'Current Settings...',
    name: 'Settings',
    icon: 'https://i.imgur.com/X9eAmHm.png',
    mentions: false,
})

npm.io

const Discord = require('discord.js');
const send = require('fast-hook');

const embed = new Discord.MessageEmbed()
    .setColor("#77C2AE")
    .setTitle(`California`)
    .setDescription(`**By *Clayton James***`)
    .setFooter(`Just a normal embed!`);

send({
    channel: message.channel,
    embeds: [embed],
    name: 'Now Playing',
    icon: 'https://i.imgur.com/44YTwve.png',
    mentions: false
})

© DomeQ#0001 2018 || Edited by Dar3k#1121