-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98a242c
commit 8dfa4a6
Showing
7 changed files
with
580 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
node_modules | ||
.github | ||
.github | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(() => {}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.