Skip to content

Commit

Permalink
Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximKing1 committed Feb 21, 2021
1 parent 98a242c commit 8dfa4a6
Show file tree
Hide file tree
Showing 7 changed files with 580 additions and 471 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
.github
.github
node_modules
35 changes: 35 additions & 0 deletions examples/top-gg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const discord = require("discord.js");
const client = discord.Client();

const { WebhooksManager } = 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 voteClient = new WebhooksManager(client, 80);
client.voteManager = voteClient;

voteClient.extraProtection(true);

voteClient.topggVoteHook("topgg", "LOADS_OF_RANDOMNESS", true);

// This code will run after a new vote was received from Botrix
client.on("BTR-voted", async function (userID) {
console.log(`${userID} Voted!`);

// Add role for 24 hours
const guildD = client.guilds.cache.get("721282458708082713");
guildD.members
.fetch(userID)
.catch(() => null)
.then((member) => {
if (!member) return;

member.roles.add("748340144897261660");

setTimeout(
() => member.roles.remove("748340144897261660").catch(console.error),
1000 * 60 * 60 * 24
);
})
.catch(() => {});
});
125 changes: 6 additions & 119 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"body-parser": "^1.19.0",
"chalk": "^4.1.0",
"cookie-parser": "^1.4.5",
"deepmerge": "^4.2.2",
"errorhandler": "^1.5.1",
"events": "^3.2.0",
"express": "^4.17.1",
Expand Down
Loading

0 comments on commit 8dfa4a6

Please sign in to comment.