out-of-your-element/addbot.js

19 lines
547 B
JavaScript
Raw Permalink Normal View History

2024-09-14 12:49:38 +00:00
#!/usr/bin/env node
2023-10-02 08:48:06 +00:00
// @ts-check
2024-09-13 11:47:11 +00:00
const {reg} = require("./src/matrix/read-registration")
const token = reg.ooye.discord_token
const id = Buffer.from(token.split(".")[0], "base64").toString()
2023-10-02 08:48:06 +00:00
function addbot() {
return `Open this link to add the bot to a Discord server:\nhttps://discord.com/oauth2/authorize?client_id=${id}&scope=bot&permissions=1610883072 `
}
2024-09-29 12:42:12 +00:00
/* c8 ignore next 3 */
2023-10-02 08:48:06 +00:00
if (process.argv.find(a => a.endsWith("addbot") || a.endsWith("addbot.js"))) {
console.log(addbot())
}
module.exports.id = id
2023-10-02 08:48:06 +00:00
module.exports.addbot = addbot