Multi-Discord-Botlist Management Package with 40+ Botlist Supported with Events and Stats Update Methods and More to Add if you want
Installation
$ npm install --save discord-botlists
Features
- Upvote/Vote Events Support 🚗
- Stats Posting Feature for Discord Bots to Multiple Botlists
- Better Event Handlers and Request Handlers
- Better Body Parsing for Incomplete request ( HTTP Post Request )
Scheme :
var discordBotlistData = {
bladebotlist: {
authorizationToken: "xxx-secrettokenhere-xxx",
authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
},
topgg: {
authorizationToken: "xxx-secrettokenhere-xxx",
authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
},
boatspace: {
authorizationToken: "xxx-secrettokenhere-xxx",
authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
},
botlistme: {
authorizationToken: "xxx-secrettokenhere-xxx",
authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
},
botrix: {
authorizationToken: "xxx-secrettokenhere-xxx",
authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
},
discordlabs: {
authorizationToken: "xxx-secrettokenhere-xxx",
authorizationValue: "xxx-selfmade-AuthorizationValue-xxx",
},
};
var webhookEndpoint = "discord-botlists";
Point to be Noted :
discordBotlistData Example from : discordBotlistData Structured Data | Where Object-Inner Values get changed with "authorizationToken" and "authorizationValue" Values | Only the name of the main key of the botlist is request like First one was "bladebotlist"
Example Code :
const { BotLists } = require("discord-botlists");
const Botlist = new BotLists(
"discord-botlists",
discordBotlistData,
8080,
"127.0.0.1"
);
new Promise(async (resolve) => {
resolve(
await Botlist.start(
"discord-botlists",
"https://github.com/SidisLiveYT/discord-botlists"
)
);
});
Botlist.on("vote", (websiteName, jsonBody, timestamp) => {
console.log("Website Name : " + websiteName);
console.log("Vote Json Data : " + jsonBody);
console.log("Date/Time : " + timestamp);
});
new Promise(async (resolve) => {
resolve(
await Botlist.poststats(
{
bot_id: undefined,
server_count: undefined,
shards: undefined,
shard_id: undefined,
shard_count: undefined,
},
false,
undefined,
true,
true
)
);
});
var Interval_Id = Botlist.autoPoster(
{
bot_id: undefined,
server_count: undefined,
shards: undefined,
shard_id: undefined,
shard_count: undefined,
},
undefined,
10 * 60 * 1000,
false,
true
);
Botlist.on("posted", (formatedResponse, timestamp) => {
console.log("SuccessRate or Failure Rate : " + formatedResponse);
console.log("Date/Time : " + timestamp);
});
Botlist.on("error", (message, extraData, timestamp) => {
console.log("Error Message : " + message);
console.log("Related Data with Error : " + extraData);
console.log("Date/Time : " + timestamp);
});
Links