Add "addbot" feature

This commit is contained in:
Cadence Ember
2023-10-02 21:48:06 +13:00
parent 6d83df2e95
commit 708955c062
6 changed files with 40 additions and 1 deletions

15
addbot.js Normal file
View File

@@ -0,0 +1,15 @@
// @ts-check
const config = require("./config")
function addbot() {
const token = config.discordToken
const id = Buffer.from(token.split(".")[0], "base64")
return `Open this link to add the bot to a Discord server:\nhttps://discord.com/oauth2/authorize?client_id=${id}&scope=bot&permissions=1610883072 `
}
if (process.argv.find(a => a.endsWith("addbot") || a.endsWith("addbot.js"))) {
console.log(addbot())
}
module.exports.addbot = addbot