Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blwebhooks-beta

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blwebhooks-beta

Webhook Vote Reciever For Lists Such As top.gg, InfinityBotList and Many More To Come!

  • 1.4.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Known Vulnerabilities npm version dependencies Status install size

NPM

BLWebhooks, The Next Gen Vote Hooks!

Installation

Need Any Help Setting It Up? Join Our Support Server.

It's intended to be used with discord.js v12.

BLWebhooks fully supports external and discord.js internal sharding, make sure to enable the Upcoming Sharded Client Module.

NPM (recommended)

npm i blwebhooks --save

Yarn

yarn add blwebhooks

Supported Lists

top.gg
InfinityBotList
VoidBots
DiscordLabs
Botrix
Blist - Support Next Update

Usage

Import the lib via ES6 or commonJS modules

// ES6
import * as blwebhooks from "blwebhooks";
// or commonJS
const blwebhooks = require("blwebhooks");

With discord.js

const discord = require("discord.js");
const client = discord.Client();

const blwebhooks = require("blwebhooks");

// Attatch The Client and Port to the module.
// The client is it attaching to the client, 80 is the port it will run on
const bl = new blwebhooks.Client(client, 80);

Turn On Sharding Support

// This will enable the extended logging, this is mainly for debugging purposes
bl.shardedClient(true);

Turn On Extended Security

// This will enable bruteforce protection for module, once enabled
// it will start the protection also using more CPU.
bl.extraProtection(true);

Turn On Proxy Trust

// Enable this option is you use this behind a proxy like
// Heroku services etc
bl.proxyTrust(true);

Emit Test Vote Events

// Emit a test event to test your Voted Event
bl.testVote(userID, botID);

Vote Hooks

TopGG Vote Hooks:

// This will listen to votes from top.gg, the url is the end not
// including the / and auth is the webhook auth. You can enable and
// disable using true or false at the end
const topgg = bl.topggVoteHook(url, auth, true);

// This code will run after a new vote was received from top.gg
BLWEvent.on('topgg-voted', async function (UserID, botID, type) {
  console.log(userID)
})

InfinityBotList Vote Hooks:

// This will listen to votes from InfinityBotList, the url is the end not
// including the / and auth is the webhook auth. You can enable and
// disable using true or false at the end
const InfinityBotList = bl.IBLVoteHook(url, auth, true);

// This code will run after a new vote was received from InfinityBotList
BLWEvent.on('IBL-voted', async function (userID, botID, type, timeStamp) {
  console.log(userID)
})

VoidBots Vote Hooks:

// This will listen to votes from VoidBots, the url is the end not
// including the / and auth is the webhook auth. You can enable and
// disable using true or false at the end
const VoidBots = bl.VoidBotsVoteHook(url, auth, true);

// This code will run after a new vote was received from VoidBots
BLWEvent.on('VB-voted', async function (userID, botID) {
  console.log(userID + " Voted For " + botID)
})

DiscordLabs Vote Hooks:

// This will listen to votes from DiscordLabs, the url is the end not
// including the / and auth is the webhook auth. You can enable and
// disable using true or false at the end
const DiscordLabs = bl.DiscordLabsVoteHook(url, auth, true);

// This code will run after a new vote was received from DiscordLabs
BLWEvent.on('DL-voted', async function (userID, botID, wasTest) {
  console.log(`${userID} Voted For ${botID}. Was Test: ${wasTest}`)
})

Botrix Vote Hooks:

// This will listen to votes from Botrix, the url is the end not
// including the / and auth is the webhook auth. You can enable and
// disable using true or false at the end
const Botrix = bl.BotrixVoteHook(url, auth, true);

// This code will run after a new vote was received from Botrix
BLWEvent.on('BTR-voted', async function (userID, botID) {
  console.log(`${userID} Voted For ${botID}.`)
})

Events

Global Voted Event

// This will run after any vote has been received, use this if you don't want seprate events for each list
BLWEvent.on('vote', async function (userID, botID, List) {
  console.log(`${userID} Voted For ${botID} on ${List}`)
})

Vote Expired Event

// This will run after the vote expires, this will be different for each list
BLWEvent.on('vote-expired', async function (userID, botID, List) {
  console.log(userID)
})

Error Event

// This code will run in the event of a error, normally it will just console.log the error but you can add custom error events here
BLWEvent.on('error', async function (error) {
  console.log(userID)
})

Keywords

FAQs

Package last updated on 14 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc