[
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020 nate\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<h2 align=\"center\">\n🔑 ward\n</h2>\n<h3 align=\"center\">\nA Discord verification bot using reCAPTCHA v2. \n</h3>\n\n## Requirements\n\n- [Node.js v16.9.0 or higher](https://nodejs.org/en/)\n- [Google reCaptcha Key](https://www.google.com/recaptcha/admin/create)\n\n## Setup\n\n- Rename your `config-example.js` file to `config.js`\n\n- Register your site with [reCaptcha](https://www.google.com/recaptcha/admin/create) with the domain you are currently using. If running locally, only put localhost on the domain area. ChoosereCAPTCHA v2 \"I'm not a robot\" for the reCaptcha Type, and copy the secret and public key into the config.js file. If you are using HTTPS, enable it in the config add your certificate and private key file with the names: `certificate.pem` and `private.pem`.\n\n- To run your own version on Repl.it, create a new project and click the `Import from Github` button and copy this repository url and paste it on the Repl.it site.\n\n- Here is what the configuration file looks like and the things that are required for the bot to run.\n```js\nmodule.exports = {\n    server: {\n        domain: \"localhost\",\n        https: false,\n        httpPort: 8080,\n    },\n\n    Discord: {\n        // —— Things that are required for the whole project to work.\n        token: \"\", // —— Your bot's token.\n        botId: \"\", // —— The bot's ID.\n        guildId: \"\", // —— The server ID on where the commands will be deployed.\n        verifiedRole: \"\", // —— Role that will be added to the user when they verify their account.\n\n        // —— For users that want to have a role removed upon verification, if you want this, set remove-role to true, and set your remove role ID.\n        removeRole: false,\n        removeRoleId: \"\",\n\n        // —— Set the bot's presence, for statusType see: https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityType\n        statusType: 3, // 1 (STREAMING), 2 (LISTENING), 3 (WATCHING), 5 (COMPETING). Default is 0 (PLAYING). \n        statusMsg: \"unverified users!\",\n\n        // —— By default, rules are set to disabled, this means rules will be hidden. If you want to use the rules function, change disabled to your rules. Please ensure you use \\n for each line break and do not use any symbols that could interfear with JSON.\n        rulesEnabled: true,\n        rules: \"Type your rules here if rulesEnabled is enabled, ensure to use \\n for new lines\"\n    },\n\n    reCAPTCHA: {\n        secretKey: \"\",\n        publicKey: \"\"\n    }\n}\n```\n\n- Finished editing the files and ready to turn on your bot? run `npm start` in the bot folder.\n\n## Issues\n\n**Not receiving a DM when joining my server**\n\n- If you are not receiving a DM when joining your server, Go to your Discord bot dashboard and enable both intents. Note: If your bot is more than 100 servers, you will have to verify your bot.\n\n**Bot failing to login**\n\n- You must go to your Discord bot dashboard and enable both intents. Note: If your bot is more than 100 servers, you will have to verify your bot.\n\n## Preview\n![Embed](https://i.imgur.com/zomEnpw.png)\n![Website](https://i.imgur.com/tmrcyjF.png)\n"
  },
  {
    "path": "assets/css/style.css",
    "content": "@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');\n\nbody {\n    background-color: #2b2b2b;\n    width: 100%;\n    height: 100%;\n    overflow: hidden;\n    font-family: 'Roboto', sans-serif;\n}\n\n#particles {\n    width: 100%;\n    height: 100%;\n    overflow: hidden;\n    z-index: -1;\n    position: fixed;\n}\n\n#app {\n    z-index: 1;\n    position: fixed;\n    top: 50%;\n    left: 50%;\n    transform: translate(-50%, -50%);\n}\n\nspan {\n    font-size: 28px;\n    font-weight: 400;\n    color: white;\n}"
  },
  {
    "path": "assets/js/particles.js",
    "content": "$(document).ready(function() {\n    $('#particles').particleground({\n        dotColor: '#b3afa8',\n        lineColor: '#b3afa8',\n        density: 50000\n    });\n})"
  },
  {
    "path": "config-example.js",
    "content": "module.exports = {\n    server: {\n        domain: \"localhost\",\n        https: false,\n        httpPort: 8080,\n    },\n\n    Discord: {\n        // —— Things that are required for the whole project to work.\n        token: \"\", // —— Your bot's token.\n        botId: \"\", // —— The bot's ID.\n        guildId: \"\", // —— The server ID on where the commands will be deployed.\n        verifiedRole: \"\", // —— Role that will be added to the user when they verify their account.\n\n        // —— For users that want to have a role removed upon verification, if you want this, set remove-role to true, and set your remove role ID.\n        removeRole: false,\n        removeRoleId: \"\",\n\n        // —— Set the bot's presence, for statusType see: https://discord-api-types.dev/api/discord-api-types-v10/enum/ActivityType\n        statusType: 3, // 1 (STREAMING), 2 (LISTENING), 3 (WATCHING), 5 (COMPETING). Default is 0 (PLAYING). \n        statusMsg: \"unverified users!\",\n\n        // —— By default, rules are set to disabled, this means rules will be hidden. If you want to use the rules function, change disabled to your rules. Please ensure you use \\n for each line break and do not use any symbols that could interfear with JSON.\n        rulesEnabled: true,\n        rules: \"Type your rules here if rulesEnabled is enabled, ensure to use \\n for new lines\"\n    },\n\n    reCAPTCHA: {\n        secretKey: \"\",\n        publicKey: \"\"\n    }\n}\n"
  },
  {
    "path": "events/guildMemberAdd.js",
    "content": "\r\n// —— dot. \r\nconst { Signale } = require('signale');\r\nconst { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');\r\nconst logger = new Signale({ scope: 'Discord' });\r\nconst config = require('../config.js');\r\nconst pool = require('../pool.js');\r\n\r\nmodule.exports = {\r\n\tname: \"guildMemberAdd\",\r\n\r\n\tasync execute(member) {\r\n        const domain = config.server.domain === 'localhost' ? `${config.server.domain}:${config.server.httpPort}` : `${config.server.domain}`; \r\n        if(config.Discord.rulesEnabled) {\r\n            const linkID = pool.createLink(member.id);\r\n            const captchaEmbed = new EmbedBuilder()\r\n                .setColor('#0099ff')\r\n                .setTitle('reCAPTCHA Verification')\r\n                .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.\\n${config.server.https ? 'https://' : 'http://'}${domain}/verify/${linkID}`)\r\n\r\n            member.send({ embeds: [captchaEmbed] }).catch(() => {\r\n                logger.error(`Failed to send captcha to user! (Maybe they have DMs turned off?)`);\r\n            });    \r\n                \r\n        } else {\r\n            const linkID = pool.createLink(member.id);\r\n            const captchaEmbed = new EmbedBuilder()\r\n                .setColor('#0099ff')\r\n                .setTitle('reCAPTCHA Verification')\r\n                .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.\\n${config.server.https ? 'https://' : 'http://'}${domain}/verify/${linkID}`)\r\n\r\n            member.send({ embeds: [captchaEmbed] }).catch(() => {\r\n                logger.error(`Failed to send captcha to user! (Maybe they have DMs turned off?)`);\r\n            });    \r\n        }\r\n        \r\n\t},\r\n};\r\n"
  },
  {
    "path": "events/interactionCreate.js",
    "content": "\r\nconst { EmbedBuilder } = require('discord.js');\r\nconst pool = require('../pool.js');\r\n\r\nmodule.exports = {\r\n\tname: \"interactionCreate\",\r\n\r\n\tasync execute(interaction) {\r\n\t\r\n        if(!interaction.isButton()) return;\r\n            if(interaction.customId === 'rules') {\r\n                logger.info('User agreed to the rules!');\r\n                interaction.user.createDM().then(dm => {\r\n                    dm.send(\"You have sucessfully agreed to rules.\").catch(console.error);\r\n                    const linkID = pool.createLink(interaction.user.id);\r\n\r\n                    const captchaEmbed = new EmbedBuilder()\r\n                        .setColor('#0099ff')\r\n                        .setTitle('reCAPTCHA Verification')\r\n                        .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.\\n${config.https ? 'https://' : 'http://'}${config.domain}/verify/${linkID}`)\r\n                \r\n                    dm.send({ embeds: [captchaEmbed] }).catch(() => {\r\n                        logger.error(`Failed to send captcha to user! (Maybe they have DMs turned off?)`);\r\n                    });\r\n                })\r\n            }\r\n\t},\r\n};"
  },
  {
    "path": "events/onReady.js",
    "content": "\r\n// —— dot. \r\nconst { Signale } = require('signale');\r\nconst config = require('../config.js');\r\nconst logger = new Signale({ scope: 'Discord' });\r\n\r\nmodule.exports = {\r\n\tname: \"ready\",\r\n\tonce: true,\r\n\r\n\tasync execute(client) {\r\n        logger.success('Bot online!');\r\n        client.user.setPresence({ activities: [{ type: config.Discord.statusType, name: `${config.Discord.statusMsg}` }], status: 'idle' })\r\n        logger.success('Status Set!');\r\n\t},\r\n};"
  },
  {
    "path": "events/slashCreate.js",
    "content": "\r\nconst { Signale } = require('signale');\r\nconst logger = new Signale({ scope: 'Pool' }); \r\n\r\nmodule.exports = {\r\n\tname: \"interactionCreate\",\r\n\r\n\tasync execute(interaction) {\r\n\r\n        const { client } = interaction;\r\n\t\tif (!interaction.isChatInputCommand()) return;\r\n\t\t\r\n        const command = client.slashCommands.get(interaction.commandName);\r\n\t\tif (!command) return;\r\n\r\n\t\ttry {\r\n\t\t\tawait command.execute(interaction);\r\n\t\t} catch (err) {\r\n\t\t\tlogger.error(err);\r\n\t\t\tawait interaction.reply({\r\n\t\t\t\tcontent: \"There was an issue while executing that command!\", ephemeral: true,\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n};"
  },
  {
    "path": "html/invalidCaptcha.html",
    "content": "<html>\n    <head>\n        <!-- HTML data -->\n        <title>Discord Verification</title>\n        <!-- CSS file -->\n        <link type='text/css' rel=\"stylesheet\" href=\"../css/style.css\">\n        <!-- JavaScript files -->\n        <script type='text/javascript' src=\"../js/jquery.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particleground.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particles.js\"></script>\n    </head>\n    <body>\n        <div id=\"particles\"></div>\n        <div id=\"app\">\n            <span>Invalid reCAPTCHA!</span>\n        </div>\n    </body>\n</html>"
  },
  {
    "path": "html/invalidLink.html",
    "content": "<html>\n    <head>\n        <!-- HTML data -->\n        <title>Discord Verification</title>\n        <!-- CSS file -->\n        <link type='text/css' rel=\"stylesheet\" href=\"../css/style.css\">\n        <!-- JavaScript files -->\n        <script type='text/javascript' src=\"../js/jquery.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particleground.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particles.js\"></script>\n    </head>\n    <body>\n        <div id=\"particles\"></div>\n        <div id=\"app\">\n            <span>Invalid link!</span>\n        </div>\n    </body>\n</html>"
  },
  {
    "path": "html/valid.html",
    "content": "<html>\n    <head>\n        <!-- HTML data -->\n        <title>Discord Verification</title>\n        <!-- CSS file -->\n        <link type='text/css' rel=\"stylesheet\" href=\"../css/style.css\">\n        <!-- JavaScript files -->\n        <script type='text/javascript' src=\"../js/jquery.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particleground.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particles.js\"></script>\n    </head>\n    <body>\n        <div id=\"particles\"></div>\n        <div id=\"app\">\n            <span>Verified!</span>\n        </div>\n    </body>\n</html>"
  },
  {
    "path": "html/verify.html",
    "content": "<html>\n    <head>\n        <!-- HTML data -->\n        <title>Discord Verification</title>\n        <!-- CSS file -->\n        <link type='text/css' rel=\"stylesheet\" href=\"../css/style.css\">\n        <!-- JavaScript files -->\n        <script type='text/javascript' src=\"../js/jquery.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particleground.min.js\"></script>\n        <script type='text/javascript' src=\"../js/particles.js\"></script>\n        <!-- reCAPTCHA JavaScript file -->\n        <script src=\"https://www.google.com/recaptcha/api.js\" async defer></script>\n    </head>\n    <body>\n        <div id=\"particles\"></div>\n        <div id=\"app\">\n            <!-- reCAPTCHA form -->\n            <form action=\"?\" method=\"POST\" id=\"reCAPTCHA\">\n                <div class=\"g-recaptcha\" data-sitekey=\"<%= publicKey %>\" data-callback=\"onSubmit\"></div>\n            </form>\n        </div>\n        <!-- reCAPTCHA callback function -->\n        <script>\n            function onSubmit() {\n                document.getElementById(\"reCAPTCHA\").submit(); \n            }\n        </script>\n    </body>\n</html>"
  },
  {
    "path": "index.js",
    "content": "\n// —— Requiring the packages the we need.\nconst fs = require(\"fs\");\nconst { Client, Collection, Partials } = require(\"discord.js\");\nconst { Signale } = require('signale');\nconst { REST } = require(\"@discordjs/rest\");\nconst { Routes } = require(\"discord-api-types/v9\");\nconst express = require('express');\nconst path = require('path');\nconst axios = require('axios');\nconst https = require('https');\nconst pool = require('./pool');\nconst config = require(\"./config.js\");\nconst logger = new Signale({ scope: 'Discord' });\n\n// —— Initializing the client.\nconst client = new Client({ \n    intents: [ 131071 ], // Basically for (most?) of the intents.\n    partials: [\n        Partials.Channel\n    ] \n});\n\n// —— All event files of the event handler.\n const eventFiles = fs\n .readdirSync(\"./events\")\n .filter((file) => file.endsWith(\".js\"));\n\nfor (const file of eventFiles) {\n const event = require(`./events/${file}`);\n if (event.once) {\n     client.once(event.name, (...args) => event.execute(...args, client));\n } else {\n     client.on(event.name, async (...args) => await event.execute(...args, client));\n }\n}\n\nclient.slashCommands = new Collection();\n\n// —— Registration of Slash-Command Interactions.\nconst slashCommands = fs.readdirSync(\"./public/slash\");\n\nfor (const module of slashCommands) {\n\tconst commandFiles = fs\n\t\t.readdirSync(`./public/slash/${module}`)\n\t\t.filter((file) => file.endsWith(\".js\"));\n\n\tfor (const commandFile of commandFiles) {\n\t\tconst command = require(`./public/slash/${module}/${commandFile}`);\n\t\tclient.slashCommands.set(command.data.name, command);\n\t}\n}\n\n// —— Registration of Slash-Commands in Discord API\nconst rest = new REST({ version: \"9\" }).setToken(config.Discord.token);\n\nconst commandJsonData = [\n\t...Array.from(client.slashCommands.values()).map((c) => c.data.toJSON()),\n];\n\n(async () => {\n\ttry {\n\t\tlogger.success(\"Started refreshing application (/) commands.\");\n\t\tawait rest.put(Routes.applicationGuildCommands(config.Discord.botId, config.Discord.guildId), { body: commandJsonData });\n\t\tlogger.success(\"Successfully reloaded application (/) commands.\");\n\t} catch (error) {\n\t\tconsole.error(error);\n\t}\n})();\n\nasync function addRole(userID) {\n    try {\n\t\tconst guild = await client.guilds.fetch(config.Discord.guildId),\n        \t role = await guild.roles.fetch(config.Discord.verifiedRole),\n          \t member = await guild.members.fetch(userID);\n\n        member.roles.add(role)\n\t\t\t.catch(() => {\n\t\t\t\tlogger.error(`Failed to add role to user ${member.user.tag}! (Maybe verified role is above bot role?)`);\n\t\t\t\treturn;\n        \t})\n\t\t\t.then(() => {\n\t\t\t\tlogger.info(`Added verified role to user ${member.user.tag}.`);\n\t\t\t})\n    } catch (e) {\n\t\tconsole.log(e)\n        logger.error(`Failed to add role to user ${userID}!`);\n    }\n}\n\nasync function removeRole(userID) {\n    const removeRole = config.Discord.removeRole\n\n\tif(removeRole) {\n\t\ttry {\n\t\t\tconst guild = await client.guilds.fetch(config.Discord.guildId),\n\t\t\t\t removeRoleId = await guild.roles.fetch(config.Discord.removeRoleId),\n\t\t\t\t member = await guild.members.fetch(userID);\n\n\t\t\tmember.roles.remove(removeRoleId)\n\t\t\t\t.catch(() => {\n\t\t\t\t\tlogger.error(`Failed to remove role from user ${member.user.tag}! (Maybe role is above bot role?)`);\n\t\t\t\t\treturn;\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tlogger.info(`Removed role from user ${member.user.tag}.`);\n\t\t\t\t})\n\t\t\t\n\t\t} catch(e) {\n\t\t\tlogger.error(`Failed to remove role from user ${userID}!`);\n\t\t}\n\t} else {\n\t\tlogger.info(`Remove role is set to false, step skipped.`)\n\t}  \n}\n\n// —— Login into your client application with bot's token.\nclient.login(config.Discord.token)\n\t.catch(() => {\n\t\tlogger.fatal('Failed to login! Is your intents enabled?');\n\t\tprocess.exit(0);\n\t})\n\n// —— And another thingy.\nconst app = express(),\n     port = config.server.https ? 443 : config.server.httpPort;\n\n// —— Define render engine and assets path\napp.engine('html', require('ejs').renderFile);\napp.use(express.static(path.join(__dirname, '/assets')));\napp.use(express.json());\napp.use(express.urlencoded({ extended: true }));\n\n// GET /verify/id\napp.get('/verify/:verifyId?', (req, res) => {\n    if (!req.params.verifyId) return res.sendFile(path.join(__dirname, '/html/invalidLink.html'));\n    if (!pool.isValidLink(req.params.verifyId)) return res.sendFile(path.join(__dirname, '/html/invalidLink.html'));\n    res.render(path.join(__dirname, '/html/verify.html'), { publicKey: config.reCAPTCHA.publicKey });\n});\n\n// POST /verify/id\napp.post('/verify/:verifyId?', async (req, res) => {\n    if (!req.body || !req.body['g-recaptcha-response']) return res.sendFile(path.join(__dirname, '/html/invalidLink.html'));\n\n    const response = await axios({\n        method: 'post',\n        url: `https://www.google.com/recaptcha/api/siteverify?secret=${config.reCAPTCHA.secretKey}&response=${req.body['g-recaptcha-response']}`,\n        headers: {\n            'Content-Type': 'application/x-www-form-urlencoded'\n        }\n    });\n\n    if (!response.data.success) return res.sendFile(path.join(__dirname, '/html/invalidCaptcha.html'));\n    if (!pool.isValidLink(req.params.verifyId)) return res.sendFile(path.join(__dirname, '/html/invalidLink.html'));\n    await addRole(pool.getDiscordId(req.params.verifyId));\n    await removeRole(pool.getDiscordId(req.params.verifyId));\n    pool.removeLink(req.params.verifyId);\n    res.sendFile(path.join(__dirname, '/html/valid.html'));\n});\n\nconst start = () => {\n\tif (config.https) {\n\t\thttps.createServer({\n\t\t\tkey: fs.readFileSync('private.pem'),\n\t\t\tcert: fs.readFileSync('certificate.pem')\n\t\t}, app).listen(port, () => logger.info(`Listening on port ${port}.`));\n\t} else {\n\t\tapp.listen(port, () => logger.info(`Listening on port ${port}.`));\n\t}\n}\n\n// —— Start the server\nstart();\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"ward\",\n  \"version\": \"4.0.0\",\n  \"description\": \"A Discord verification bot using reCAPTCHA v2.\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"start\": \"node --no-warnings ./index.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/nates/ward.git\"\n  },\n  \"author\": \"nates\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/nates/ward/issues\"\n  },\n  \"homepage\": \"https://github.com/nates/ward#readme\",\n  \"dependencies\": {\n    \"@discordjs/rest\": \"^1.0.1\",\n    \"axios\": \"^0.21.1\",\n    \"body-parser\": \"^1.19.0\",\n    \"discord.js\": \"^14.0.3\",\n    \"ejs\": \"^3.1.8\",\n    \"express\": \"^4.18.1\",\n    \"https\": \"^1.0.0\",\n    \"signale\": \"^1.4.0\"\n  }\n}\n"
  },
  {
    "path": "pool.js",
    "content": "\n// —— Requiring the packages that we need for this file.\nconst { Signale } = require('signale');\nconst createCode = require('./public/util.js').createCode;\nconst logger = new Signale({ scope: 'Pool' }); \n\n// —— Making the functions!!\nlet linkPool = [];\n\nfunction createLink(discordID) { \n    const linkID = createCode(8);\n    linkPool.push({\n        discordID: discordID,\n        linkID: linkID\n    });\n    setTimeout(function() {\n        if (isValidLink(linkID)) removeLink(linkID);\n    }, 900000);\n    logger.info('Created new link ID:', linkID);\n    return linkID;\n}\n\nfunction isValidLink(linkID) {\n    for (let i = 0; i < linkPool.length; i++) if (linkPool[i].linkID == linkID) return true;\n    return false;\n}\n\nfunction removeLink(linkID) {\n    for (let i = 0; i < linkPool.length; i++) if (linkPool[i].linkID == linkID) delete linkPool[i];\n    linkPool = linkPool.filter(n => n);\n}\n\nfunction getDiscordId(linkID) {\n    for (let i = 0; i < linkPool.length; i++) if (linkPool[i].linkID == linkID) return linkPool[i].discordID;\n    return false;\n}\n\n\nmodule.exports = { isValidLink, removeLink, createLink, getDiscordId };\n"
  },
  {
    "path": "public/slash/misc/ping.js",
    "content": "\r\nconst { SlashCommandBuilder } = require(\"discord.js\");\r\n\r\nmodule.exports = {\r\n\tdata: new SlashCommandBuilder()\r\n\t\t.setName(\"ping\")\r\n\t\t.setDescription(\r\n\t\t\t\"Test to see if bot is online.\"\r\n\t\t),\r\n\r\n\tasync execute(interaction) {\r\n        interaction.reply(\"Pong!\");\r\n\t},\r\n};"
  },
  {
    "path": "public/slash/verify/verify.js",
    "content": "\r\nconst { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require(\"discord.js\");\r\nconst config = require(\"../../../config.js\");\r\nconst pool = require(\"../../../pool.js\")\r\n\r\nmodule.exports = {\r\n\tdata: new SlashCommandBuilder()\r\n\t\t.setName(\"verify\")\r\n\t\t.setDescription(\r\n\t\t\t\"Verify yourself in the server!\"\r\n\t\t),\r\n\r\n\tasync execute(interaction) {\r\n        const domain = config.server.domain === 'localhost' ? `${config.server.domain}:${config.server.httpPort}` : `${config.server.domain}`; \r\n\r\n        if(interaction.member.roles.cache.some(r => r.id === config.Discord.verifiedRole)) {\r\n            await interaction.reply(\"Whoops, you are already verified!\");\r\n            return;\r\n        }\r\n\r\n        const button = new ActionRowBuilder()\r\n        .addComponents(\r\n            new ButtonBuilder()\r\n                .setCustomId(\"rules\")\r\n                .setLabel('Agree')\r\n                .setEmoji('✅')\r\n                .setStyle(1)\r\n            )\r\n\r\n        const embed = new EmbedBuilder()\r\n            .setColor('#0099ff')\r\n            .setTitle('Rules')\r\n            .setDescription(config.Discord.rules);\r\n\r\n        if(config.Discord.rulesEnabled) {\r\n            await interaction.reply('Please check your DMS!')\r\n\r\n            const linkID = pool.createLink(interaction.user.id);\r\n\r\n            const captchaEmbed = new EmbedBuilder()\r\n            .setColor('#0099ff')\r\n            .setTitle('reCAPTCHA Verification')\r\n            .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.\\n${config.server.https ? 'https://' : 'http://'}${domain}/verify/${linkID}`)\r\n\r\n            await interaction.user.createDM().then(async (dm) => {\r\n                await dm.send({ embeds: [captchaEmbed] }).catch(() => {\r\n                    logger.error(`Failed to send captcha to user! (Maybe they have DMs turned off?)`);\r\n                });\r\n            });\r\n\r\n        } else {\r\n            await interaction.reply('Please check your DMS!')\r\n\r\n            const linkID = pool.createLink(interaction.user.id);\r\n\r\n            const captchaEmbed = new EmbedBuilder()\r\n            .setColor('#0099ff')\r\n            .setTitle('reCAPTCHA Verification')\r\n            .setDescription(`To gain access to this server you must solve a captcha. The link will expire in 15 minutes.\\n${config.server.https ? 'https://' : 'http://'}${domain}/verify/${linkID}`)\r\n\r\n            await interaction.user.createDM().then(async (dm) => {\r\n                await dm.send({ embeds: [captchaEmbed] }).catch(() => {\r\n                    logger.error(`Failed to send captcha to user! (Maybe they have DMs turned off?)`);\r\n                })\r\n\r\n            });\r\n        }\r\n    },\r\n};"
  },
  {
    "path": "public/util.js",
    "content": "\r\n// uwu.\r\nfunction createCode(length) { \r\n    let characters = \r\n        'abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\r\n\r\n    let result = '';\r\n    for (let i = 0; i < length; i++) {\r\n        result += characters.charAt(Math.floor(Math.random() * characters.length));\r\n    }\r\n\r\n    return result;\r\n}\r\n\r\nmodule.exports = { createCode };"
  }
]