From 30faa0a6e270a6a73a1c9b1b78f2842e7b6b667f Mon Sep 17 00:00:00 2001 From: Pexilo Date: Tue, 11 Oct 2022 14:42:01 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=8E=20Verification,=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🛡️ New feature, user will be asked to fill a captcha to acces to the server 🚧 Guild schema updated with verify object 📃 Env file template mongodb url fix 🎨 New embed color, sober one 🖇️ GenerateCaptcha function ✅ Fixed clear error exit, and logging message ✅ Fixed catch error for roleclaim message --- README.md | 8 +- example.env | 2 +- package.json | 2 +- src/commands/admin/setup-Ids.js | 177 +++++++++++++++--- src/db-model/guild.js | 8 +- .../buttons/clear-confirm-button.js | 12 +- .../buttons/moderation-tools-buttons.js | 21 ++- .../buttons/setup-first-button.js | 14 +- src/interactions/buttons/verify-buttons.js | 111 +++++++++++ src/interactions/modals/verify-modal.js | 47 +++++ .../select-menus/moderation-tools-select.js | 2 + .../select-menus/setup-second-select.js | 64 ++++++- src/languages/de.json | 71 ++++++- src/languages/en.json | 70 ++++++- src/languages/es.json | 70 ++++++- src/languages/fr.json | 82 +++++++- src/util/functions.js | 12 +- 17 files changed, 691 insertions(+), 82 deletions(-) create mode 100644 src/interactions/buttons/verify-buttons.js create mode 100644 src/interactions/modals/verify-modal.js diff --git a/README.md b/README.md index 71ab070..15324bc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
- Version + Version @@ -42,7 +42,7 @@ Stealthy is my first ambitious personal project, it has been under development s - Complete logging system - Ban, kick, warm, mute users -- Blacklist protection against bots raids and scammers +- Blacklist, Verification protection - Discord invites suppression - Lock, slowdown, clear channels @@ -59,7 +59,7 @@ Stealthy is my first ambitious personal project, it has been under development s ## 🌎 Supported Languages #### • ☕ English᲼᲼᲼᲼᲼᲼᲼᲼• 💃 Spanish -#### • 🥖 French᲼᲼᲼᲼᲼᲼᲼᲼᲼᲼• 🥨 Deutsch +#### • 🥖 French᲼᲼᲼᲼᲼᲼᲼᲼• 🥨 Deutsch > Thanks to Github Copilot for making most of the translations possible... 😵‍💫 Feel free to report any [bad translations](https://github.com/Pexilo/Stealthy/labels/translation) @@ -135,7 +135,7 @@ _Note: Your bot must have all privileged gateway intents checked to work properl ``` TOKEN=your-bot-token DEEPL_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:fx -MONGO_URI=mongodb+srv://username:password@clusterName.6bo3a.mongodb.net/Data +MONGO_URI=mongodb+srv://username:password@clusterName.xxxxx.mongodb.net/Data ``` 2. Rename the file `example.env` > `.env` diff --git a/example.env b/example.env index f8bddfb..92ea0f5 100644 --- a/example.env +++ b/example.env @@ -1,3 +1,3 @@ TOKEN=your-bot-token DEEPL_API_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX:fx -MONGO_URI=mongodb+srv://username:password@clusterName.6bo3a.mongodb.net/Data \ No newline at end of file +MONGO_URI=mongodb+srv://username:password@clusterName.xxxxx.mongodb.net/Data \ No newline at end of file diff --git a/package.json b/package.json index 9c65072..3c7148f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stealthy", - "version": "1.2.3", + "version": "1.2.4", "description": "Lightweight, easy to use discord bot meant to enrich the lifestyle of your server.", "main": "src/client.js", "scripts": { diff --git a/src/commands/admin/setup-Ids.js b/src/commands/admin/setup-Ids.js index 1781d22..594564e 100644 --- a/src/commands/admin/setup-Ids.js +++ b/src/commands/admin/setup-Ids.js @@ -103,6 +103,16 @@ module.exports = class SetupBotCommand extends Command { }, value: "membercount", }, + { + name: "🔎 Verify channel - allow users to verify themselves with a captcha", + nameLocalizations: { + fr: "🔎 Salon 'Verify' - Permettre aux utilisateurs de se vérifier eux-mêmes avec un captcha", + de: "🔎 Verify-Kanal - Benutzern erlauben, sich selbst mit einem Captcha zu verifizieren", + "es-ES": + "🔎 Canal de 'Verify' - Permitir a los usuarios verificarse a sí mismos con un captcha", + }, + value: "verify", + }, ], }, { @@ -912,34 +922,35 @@ module.exports = class SetupBotCommand extends Command { .send({ content: setupIds.channels.roleclaim.tipMsg, }) - .then((tipMsg) => { + .then(async (tipMsg) => { this.client.UpdateGuild(guild, { "roleClaim.tipMessage": tipMsg.id, }); - }); - }); - - await this.client.Wait(1000); - return interaction.editReply({ - content: eval(setupIds.channels.roleclaim.reply), - components: [ - this.client.ButtonRow([ - { - customId: "edit-roleclaim", - label: setupIds.channels.roleclaim.button1, - style: "PRIMARY", - emoji: "✏️", - }, - { - customId: "delete-roleclaim", - label: setupIds.channels.roleclaim.button2, - style: "SECONDARY", - emoji: "🗑", - }, - ]), - ], - }); + await this.client.Wait(1000); + interaction.editReply({ + content: eval(setupIds.channels.roleclaim.reply), + components: [ + this.client.ButtonRow([ + { + customId: "edit-roleclaim", + label: setupIds.channels.roleclaim.button1, + style: "PRIMARY", + emoji: "✏️", + }, + { + customId: "delete-roleclaim", + label: setupIds.channels.roleclaim.button2, + style: "SECONDARY", + emoji: "🗑", + }, + ]), + ], + }); + }); + }) + .catch(() => interaction.editReply(errors.error26)); + return; } if (usage === "membercount") { //permissions check @@ -1100,7 +1111,7 @@ module.exports = class SetupBotCommand extends Command { content: eval(errors.error52), }); - if (channel.type === ChannelType.GuildCategory) + if (channel.type !== ChannelType.GuildText) return interaction.editReply(errors.error26); await this.client.UpdateGuild(guild, { "logs.channel": channel.id }); @@ -1175,7 +1186,121 @@ module.exports = class SetupBotCommand extends Command { ], }); } - break; + + if (usage === "verify") { + requiredPerms = ["SendMessages", "EmbedLinks", "ManageRoles"]; + + if ( + !me.permissions.has( + PermissionFlagsBits.SendMessages | + PermissionFlagsBits.EmbedLinks | + PermissionFlagsBits.ManageRoles + ) + ) + return interaction.editReply({ + content: eval(errors.error52), + }); + + if (channel.type !== ChannelType.GuildText) + return interaction.editReply(errors.error26); + + let verifyRole = await guild.roles.cache.find( + (r) => r.id === fetchGuild.verify.role + ); + + if (fetchGuild.verify.channel) { + const channelFound = await guild.channels.cache.get( + fetchGuild.verify.channel + ); + await channelFound.messages + .fetch(fetchGuild.verify.message) + .then((msg) => { + if (msg) msg.delete().catch(() => undefined); + }) + .catch(() => { + this.client.UpdateGuild(guild, { + "verify.channel": null, + "verify.message": null, + }); + }); + } + + await this.client.UpdateGuild(guild, { + "verify.channel": channel.id, + }); + + guild.roles.everyone.setPermissions(0n); + if (!verifyRole) { + await guild.roles + .create({ + name: setupIds.channels.verify.roleName, + mentionable: false, + hoist: false, + permissions: [ + PermissionFlagsBits.SendMessages, + PermissionFlagsBits.ViewChannel, + PermissionFlagsBits.ReadMessageHistory, + ], + }) + .then(async (role) => { + verifyRole = role; + await this.client.UpdateGuild(guild, { + "verify.role": role.id, + }); + }) + .catch(() => interaction.editReply(errors.error54)); + } + + if (!verifyRole) return; + channel.permissionOverwrites.edit(guild.roles.everyone.id, { + ViewChannel: true, + ReadMessageHistory: true, + }); + + await channel + .send({ + embeds: [ + this.client + .Embed() + .setTitle(setupIds.channels.verify.embed1.title) + .setDescription(setupIds.channels.verify.embed1.description), + ], + components: [ + this.client.ButtonRow([ + { + customId: "verify", + label: setupIds.channels.verify.button1, + style: "SUCCESS", + emoji: "✅", + }, + ]), + ], + }) + .then(async (msg) => { + await this.client.UpdateGuild(guild, { + "verify.message": msg.id, + }); + }) + .catch(() => + interaction.editReply({ + content: errors.error26, + }) + ); + + return interaction.editReply({ + content: eval(setupIds.channels.verify.reply), + components: [ + this.client.ButtonRow([ + { + customId: "verify-edit", + label: setupIds.channels.verify.button2, + style: "SECONDARY", + emoji: "🔧", + }, + ]), + ], + }); + } case "blacklist": if (!(await this.client.Defer(interaction))) return; diff --git a/src/db-model/guild.js b/src/db-model/guild.js index e443d0e..c3f35e2 100644 --- a/src/db-model/guild.js +++ b/src/db-model/guild.js @@ -7,7 +7,7 @@ const guildSchema = new mongoose.Schema({ moderationTools: { enabled: { type: Array, - default: ["blacklist"], + default: ["blacklist", "verifyCaptcha"], }, }, @@ -37,6 +37,12 @@ const guildSchema = new mongoose.Schema({ fields: { type: Array, default: [] }, }, + verify: { + channel: { type: String, default: null }, + message: { type: String, default: null }, + role: { type: String, default: null }, + }, + autoRole: { roles: { type: Array, default: [] }, }, diff --git a/src/interactions/buttons/clear-confirm-button.js b/src/interactions/buttons/clear-confirm-button.js index 4ed3f87..922fa82 100644 --- a/src/interactions/buttons/clear-confirm-button.js +++ b/src/interactions/buttons/clear-confirm-button.js @@ -13,14 +13,22 @@ module.exports = class ClearConfirmButton extends Button { const { errors } = this.client.la[lang]; const { clearConfirm } = this.client.la[lang].interactions.buttons; + // get the amount of messages to delete from the message content const number = message.content.match(/\d+/)[0]; - let realNb; + + // realNb will be the real number of messages to delete + let realNb, + err41 = false; // if the messages are older than 14 days await channel .bulkDelete(number) .then((nb) => (realNb = nb.size)) .catch((e) => { + err41 = true; return button.editReply(errors.error41); }); + if (err41) return; + + // wait for deletes to be done await this.client.Wait(2000); button.editReply({ @@ -30,7 +38,7 @@ module.exports = class ClearConfirmButton extends Button { const logsChannel = this.client.channels.cache.get(fetchGuild.logs.channel); const enabledLogs = fetchGuild.logs.enabled; if (!logsChannel || !enabledLogs.includes("channels")) return; - await this.client.LogsChannelPermsCheck(guild, interaction, errors); + await this.client.LogsChannelPermsCheck(guild, button, errors); logsChannel .send({ diff --git a/src/interactions/buttons/moderation-tools-buttons.js b/src/interactions/buttons/moderation-tools-buttons.js index 044e801..d1bd7af 100644 --- a/src/interactions/buttons/moderation-tools-buttons.js +++ b/src/interactions/buttons/moderation-tools-buttons.js @@ -2,7 +2,12 @@ const { Button } = require("sheweny"); module.exports = class moderationToolsButtons extends Button { constructor(client) { - super(client, ["blacklist-tool", "delDcInvites-tool"]); + super(client, [ + "blacklist-tool", + "delDcInvites-tool", + "verify-captcha-tool-enable", + "verify-captcha-tool-disable", + ]); } async execute(button) { @@ -26,6 +31,20 @@ module.exports = class moderationToolsButtons extends Button { button.editReply(moderationTools.delDcInv.reply); break; + + case "verify-captcha-tool-enable": + if (!modTools.includes("verifyCaptcha")) modTools.push("verifyCaptcha"); + + button.editReply(moderationTools.verifyCaptcha.reply1); + break; + + case "verify-captcha-tool-disable": + if (modTools.includes("verifyCaptcha")) { + modTools.splice(modTools.indexOf("verifyCaptcha"), 1); + } + + button.editReply(moderationTools.verifyCaptcha.reply2); + break; } await this.client.UpdateGuild(guild, { diff --git a/src/interactions/buttons/setup-first-button.js b/src/interactions/buttons/setup-first-button.js index 8c7cdf2..2b27790 100644 --- a/src/interactions/buttons/setup-first-button.js +++ b/src/interactions/buttons/setup-first-button.js @@ -47,18 +47,24 @@ module.exports = class SetupMenuButton extends Button { { label: setupFirst.modal1.option5.label, description: setupFirst.modal1.option5.description, - value: "blacklist_option", - emoji: "🛡️", + value: "verify_option", + emoji: "🔎", }, { label: setupFirst.modal1.option6.label, description: setupFirst.modal1.option6.description, - value: "moderation_option", - emoji: "🗡️", + value: "blacklist_option", + emoji: "🛡️", }, { label: setupFirst.modal1.option7.label, description: setupFirst.modal1.option7.description, + value: "moderation_option", + emoji: "🗡️", + }, + { + label: setupFirst.modal1.option8.label, + description: setupFirst.modal1.option8.description, value: "lang_option", emoji: "🌐", }, diff --git a/src/interactions/buttons/verify-buttons.js b/src/interactions/buttons/verify-buttons.js new file mode 100644 index 0000000..7081f62 --- /dev/null +++ b/src/interactions/buttons/verify-buttons.js @@ -0,0 +1,111 @@ +const { Button } = require("sheweny"); +const { PermissionFlagsBits } = require("discord.js"); + +module.exports = class verifyButton extends Button { + constructor(client) { + super(client, ["verify", /verify-.*/, "verify-edit"]); + } + + async execute(button) { + const { guild, member } = button; + const { fetchGuild, lang } = await this.client.FetchAndGetLang(guild); + const { errors } = this.client.la[lang]; + const { verify } = this.client.la[lang].interactions.buttons; + + const me = await guild.members.fetchMe(); + const requiredPerms = ["ManageRoles"]; + + if (!me.permissions.has(PermissionFlagsBits.ManageRoles)) + return selectMenu.editReply({ + content: eval(errors.error52), + }); + + const role = guild.roles.cache.get(fetchGuild.verify.role); + if (!role) + return button.editReply({ + content: errors.error54, + }); + + switch (button.customId) { + case "verify": + if (!(await this.client.Defer(button))) return; + + // check the member verification + if (member.roles.cache.has(role.id)) + return button.editReply({ + content: verify.alreadyVerified, + }); + + // check if the captcha is disabled + if (!fetchGuild.moderationTools.enabled.includes("verifyCaptcha")) { + member.roles.add(role).catch(() => undefined); + return button.editReply({ content: verify.reply1 }); + } + + // generate sequence and send it with the button id + const sequence = await this.client.GenerateCaptcha(); + button.editReply({ + embeds: [ + this.client + .Embed() + .setTitle(verify.embed1.title) + .setDescription(verify.embed1.description) + .setFields({ + name: verify.embed1.field1, + value: `\`\`\`${sequence}\`\`\``, + }), + ], + components: [ + this.client.ButtonRow([ + { + customId: `verify-${sequence}`, + label: verify.button1, + style: "SECONDARY", + emoji: "🤖", + }, + ]), + ], + }); + break; + + case "verify-edit": + if (!(await this.client.Defer(button))) return; + + button.editReply({ + content: verify.reply2, + components: [ + this.client.ButtonRow([ + { + customId: "verify-captcha-tool-enable", + label: verify.button2, + style: "SECONDARY", + emoji: "✅", + }, + { + customId: "verify-captcha-tool-disable", + label: verify.button3, + style: "SECONDARY", + emoji: "❌", + }, + ]), + ], + }); + break; + + case button.customId.match(/verify\-.{5}/g)[0]: // verify-xxxxx + // get the sequence and send it with the modal id + const sendSequence = button.customId.split("-")[1]; + await button.showModal( + this.client.ModalRow(`verify-${sendSequence}`, verify.modal1.title, [ + { + customId: "verify-input", + label: verify.modal1.field1, + style: "Short", + placeholder: `${sendSequence}`, + required: true, + }, + ]) + ); + } + } +}; diff --git a/src/interactions/modals/verify-modal.js b/src/interactions/modals/verify-modal.js new file mode 100644 index 0000000..ba449d5 --- /dev/null +++ b/src/interactions/modals/verify-modal.js @@ -0,0 +1,47 @@ +const { Modal } = require("sheweny"); + +module.exports = class verifyModal extends Modal { + constructor(client) { + super(client, [/verify-.*/]); + } + + async execute(modal) { + const { guild, user, customId, fields } = modal; + + const { fetchGuild, lang } = await this.client.FetchAndGetLang(guild); + const { errors } = this.client.la[lang]; + const { verify } = this.client.la[lang].interactions.modals; + + const userSequence = fields.getTextInputValue("verify-input"); + + const role = guild.roles.cache.get(fetchGuild.verify.role); + if (!role) + return modal.editReply({ + content: errors.error54, + }); + const member = guild.members.cache.get(user.id); + + // check if the entered sequence is correct + if (!userSequence === customId.split("-")[1]) { + modal.reply({ + content: verify.badCode, + ephemeral: true, + }); + } + + // check the member verification + if (member.roles.cache.has(role.id)) { + return modal.reply({ + content: verify.alreadyVerified, + ephemeral: true, + }); + } + + // add the role + member.roles.add(role); + modal.reply({ + content: verify.reply, + ephemeral: true, + }); + } +}; diff --git a/src/interactions/select-menus/moderation-tools-select.js b/src/interactions/select-menus/moderation-tools-select.js index 7d51044..a0aa350 100644 --- a/src/interactions/select-menus/moderation-tools-select.js +++ b/src/interactions/select-menus/moderation-tools-select.js @@ -23,6 +23,8 @@ module.exports = class moderationToolsSelect extends SelectMenu { return moderationTools.spelledValues.blacklist; case "delDcInvites": return moderationTools.spelledValues.delDcInv; + case "verifyCaptcha": + return moderationTools.spelledValues.verifyCaptcha; } }) .join(", "); diff --git a/src/interactions/select-menus/setup-second-select.js b/src/interactions/select-menus/setup-second-select.js index 59d7f34..d2a48a6 100644 --- a/src/interactions/select-menus/setup-second-select.js +++ b/src/interactions/select-menus/setup-second-select.js @@ -56,6 +56,7 @@ module.exports = class setupSecondSelect extends SelectMenu { //can't change right here channels Id's, notify user to do it manually with /setup channels const logsChannel = fetchGuild.logs.channel; const roleclaimChannel = fetchGuild.roleClaim.channel; + const verifyChannel = fetchGuild.verify.channel; const membercountChannel = guild.channels.cache.get( fetchGuild.memberCount.channel ); @@ -71,7 +72,8 @@ module.exports = class setupSecondSelect extends SelectMenu { logsChannel || roleclaimChannel || membercountChannel || - JTCChannel + JTCChannel || + verifyChannel ) { let buttons = []; if (logsChannel) { @@ -110,12 +112,62 @@ module.exports = class setupSecondSelect extends SelectMenu { }); } + if (verifyChannel) { + buttons.push({ + customId: "verify-edit", + label: setupSecond.channels.button5, + style: "SECONDARY", + emoji: "🔎", + }); + } + return selectMenu.editReply({ components: [this.client.ButtonRow(buttons)], }); } break; + case "verify_option": + requiredPerms = ["ViewChannel", "EmbedLinks", "ManageRoles"]; + + if ( + !me.permissions.has( + PermissionFlagsBits.ViewChannel | + PermissionFlagsBits.EmbedLinks | + PermissionFlagsBits.ManageRoles + ) + ) + return selectMenu.editReply({ + content: eval(errors.error52), + }); + + const verifyCnl = await guild.channels + .fetch(fetchGuild.verify.channel) + .catch(() => undefined); + const verifyMsg = await verifyCnl.messages + .fetch(fetchGuild.verify.message) + .catch(() => undefined); + + selectMenu.editReply({ + content: eval(setupSecond.verify.reply), + }); + + if (verifyCnl) { + return selectMenu.editReply({ + components: [ + this.client.ButtonRow([ + { + customId: "verify-edit", + label: setupSecond.verify.button1, + style: "SECONDARY", + emoji: "🔧", + }, + ]), + ], + }); + } + break; + case "jtc_option": requiredPerms = [ "ViewChannel", @@ -336,8 +388,16 @@ module.exports = class setupSecondSelect extends SelectMenu { emoji: "🔗", default: moderationTools.enabled.includes("delDcInvites"), }, + { + label: setupSecond.moderation.select1.option3.label, + description: + setupSecond.moderation.select1.option3.description, + value: "verifyCaptcha", + emoji: "🔎", + default: moderationTools.enabled.includes("verifyCaptcha"), + }, ], - { min: 0, max: 2 } + { min: 0, max: 3 } ), ], }); diff --git a/src/languages/de.json b/src/languages/de.json index a5b4d0b..e87213f 100644 --- a/src/languages/de.json +++ b/src/languages/de.json @@ -142,6 +142,16 @@ "description": "Wenn eine Nachricht von einem Benutzer bearbeitet wird." } } + }, + "verify": { + "reply": "`\\`🔎\\` Verifizierungschannel ist jetzt in ${channel.toString()}.\\n\\n> **Hinweis:** Ich habe die Rolle ${verifyRole.toString()} erstellt.\\n> Du kannst diese Rolle nach deinem Geschmack ändern. *\\`ViewChannel\\` Berechtigung ist obligatorisch*\\n> Es ist nicht ratsam, die Funktion 'Auto Role' zusammen mit dieser zu verwenden.`", + "roleName": "Verifiziert", + "embed1": { + "title": "Verifizierung", + "description": "Drücke die Schaltfläche unten, um dich zu verifizieren." + }, + "button1": "Verifizieren", + "button2": "Bearbeiten" } }, "blacklist": { @@ -439,6 +449,23 @@ "reply": "`\\`✅\\` JTC-Kanalnamen wurden auf folgendes zurückgesetzt:\n> ${defaultNames.join(',\\n> ')}`" } }, + "verify": { + "reply1": "`✅` Du bist nun verifiziert!", + "reply2": "`🔎` Du kannst entscheiden, ob du einen Captcha verwenden möchtest oder nicht.\n\n> Ein Captcha ist ein **zufälliger Code**, den die Neulinge eingeben müssen, um sich **zu verifizieren**.\n> Wenn du keinen Captcha verwenden möchtest, werden die Neulinge einfach durch **Klicken auf die Schaltfläche verifiziert**.", + "alreadyVerified": "`❎` Du bist bereits verifiziert.", + "embed1": { + "title": "Verifizierung", + "description": "Bitte geben Sie den folgenden Code mit der Schaltfläche unten ein, um sich zu verifizieren.", + "field1": "Code" + }, + "button1": "Ich bin kein Roboter", + "button2": "Captcha aktivieren", + "button3": "Deaktivieren", + "modal1": { + "title": "Bestätige deine Identität", + "field1": "Verifizierungscode" + } + }, "logsTypes": { "select1": { "title": "Welche Logs möchtest du sehen?", @@ -477,6 +504,10 @@ }, "delDcInv": { "reply": "`🔗` Discord-Links-Unterdrücker ist jetzt aktiviert ✅\n\n> Du kannst deinen Befehl erneut ausführen" + }, + "verifyCaptcha": { + "reply1": "`🔎` Captcha verification ist aktiviert ✅\n\n> Es wird jetzt den Benutzer auffordern, einen zufälligen Code einzugeben, wenn er dem Server beitritt.", + "reply2": "`🔎` Captcha verification ist deaktiviert ❎\n\n> Es wird einfach die Rolle dem Neuling geben." } }, "roleclaim": { @@ -528,14 +559,18 @@ "description": "OPTIONAL - Gebe Rollen an Neulinge" }, "option5": { - "label": "Blacklist", - "description": "OPTIONAL - Schütze deinen Server vor Bots, Betrügereien usw." + "label": "Verifizierung", + "description": "OPTIONAL - Verifiziere Neulinge mit einem Captcha" }, "option6": { + "label": "Blacklist", + "description": "OPTIONAL - Ausschließen Sie temporär neue Konten" + }, + "option7": { "label": "Moderation Tools", "description": "OPTIONAL - Aktiviere oder deaktiviere Moderationsfunktionen" }, - "option7": { + "option8": { "label": "Sprache", "description": "OPTIONAL - Ändere die Sprache des Bots" } @@ -565,6 +600,11 @@ }, "roleclaimEmbed": { "reply": "`✅` Roleclaim-Nachricht aktualisiert." + }, + "verify": { + "reply": "`✅` Du bist jetzt verifiziert!", + "badCode": "`❎` Ungültiger Code.\nBitte versuche es erneut.", + "alreadyVerified": "`❎` Du bist bereits verifiziert." } }, "selectMenus": { @@ -575,14 +615,16 @@ "msgEdit": "\n`✍` *Nachrichtenbearbeitungen*", "joinLeave": "\n`🚪` *Beitreten & Verlassen*", "moderation": "\n`🛡️` *Moderation*", - "channels": "\n`📙` *Kanäle*" + "channels": "\n`📙` *Kanäle*", + "verifyCaptcha": "\n`🔎` *Verifizierung Captcha*" } }, "moderationTools": { "reply": "`**Moderationswerkzeuge aktiviert:**${!spelledValues ? ' ❎' : spelledValues}`", "spelledValues": { "blacklist": "\n`🛡️` *Blacklist*", - "delDcInv": "\n`🔗` *Discord-Links-Unterdrücker*" + "delDcInv": "\n`🔗` *Discord-Links-Unterdrücker*", + "verifyCaptcha": "\n`🔎` *Verifizierung Captcha*" } }, "setupLanguageThird": { @@ -596,12 +638,12 @@ } }, "channels": { - "reply": "`${logsChannel ? `> **\\`🚀\\` Logs** Kanal ist in <#${logsChannel}> eingerichtet. \n`: ''} ${roleclaimChannel ? `> **\\`🗂️\\` Role claim** Kanal ist in <#${roleclaimChannel}> eingerichtet. \n`: ''} ${membercountChannel ? `> **\\`🧾\\` Mitgliederzähler** Kanal ist in **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'default'}** Kategorie eingerichtet. \n`: ''} ${JTCChannel ? `> **\\`🔊\\` Join to Create** Kanal ist in **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'default'}** Kategorie eingerichtet. \n`: ''}\n\\`🚀\\` Bitte benutze, den \\`/setup channels\\` Befehl, um deine Kanäle einzurichten.`", + "reply": "`${logsChannel ? `> **\\`🚀\\` Logs** Kanal ist in <#${logsChannel}> eingerichtet. \n`: ''} ${verifyChannel ? `> **\\`🔎\\` Verify** Nachricht ist in <#${verifyChannel}> eingerichtet.\n` : ''} ${roleclaimChannel ? `> **\\`🗂️\\` Role claim** Kanal ist in <#${roleclaimChannel}> eingerichtet. \n`: ''} ${membercountChannel ? `> **\\`🧾\\` Member count** Kanal ist in **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'default'}** Kategorie eingerichtet. \n`: ''} ${JTCChannel ? `> **\\`🔊\\` Join to Create** Kanal ist in **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'default'}** Kategorie eingerichtet. \n`: ''}\n\\`🚀\\` Bitte benutze den Befehl \\`/setup channels\\` um deine Kanäle einzurichten.\n\\`🔎\\` Du kannst das Captcha deaktivieren und einfach die Rolle geben, benutze die Option 'Moderation Tools' im \\`/setup menu\\`.`", "button1": "Logs einrichten", - "button2": "Role Claim-Nachricht bearbeiten", "button3": "Mitgliederzähler umbenennen", - "button4": "Join to Create-Namen bearbeiten" + "button4": "Join to Create-Namen bearbeiten", + "button5": "Verifizierung bearbeiten" }, "jtc": { "reply1": "`\\`🔊\\` **Join to Create** ist eine Funktion, die den **Voice Channel-Speicher** bereinigt, indem sie **einen einzelnen Kanal** nutzt, um neue Voice Channels zu generieren.\n\n> JTC-Kanal ${findChannel.toString()} ist derzeit in **${findChannel.parent ? findChannel.parent.toString() : 'default'}** Kategorie eingerichtet.\n\nBitte benutze die **Buttons unten**, um diese Funktion zu **bearbeiten**.`", @@ -637,8 +679,16 @@ "option2": { "label": "Discord Einladungen unterdrücken", "description": "Löscht automatisch Einladungen, die von Nicht-Moderatoren gesendet wurden" + }, + "option3DE": { + "label": "Verification captcha", + "description": "Ein captcha wird für die Verifizierungsfunktion angefordert." } } + }, + "verifyDE": { + "reply": "`\\`🔎\\` Verifizierungssystem **schützt Ihren Server** vor möglichen Überfällen und Betrügereien, indem es Neulingen **erzwingt, ein Captcha auszufüllen** oder auf einen Button zu klicken, je nach Ihren Einstellungen.\\n\\n \\`⚠️\\` Es wird nicht empfohlen, das **Auto Role**-System zusammen mit diesem zu verwenden.\nVerwenden Sie \\`/setup channels\\` um es einzurichten.${\r\n verifyMsg\r\n ? `\\n\\n> Verifizierungssystem ist derzeit in ${verifyCnl.toString()} eingerichtet.${\r\n fetchGuild.moderationTools.enabled.includes(\"verifyCaptcha\")\r\n ? \"\\n> Captcha ist **aktiviert**.\"\r\n : \"\\n> Captcha ist **deaktiviert**.\"\r\n }`\r\n : \"\"\r\n}`", + "button1": "Bearbeiten" } } } @@ -669,7 +719,7 @@ "error23": "`🚫` Keine Autorolle festgelegt.\n\n> Legen Sie eine mit `/setup autorole hinzufügen` fest", "error24": "`\\`🚫\\` ${roleAR.toString()} ist nicht in der Liste.${moreThanOneRole? `\n\n> Rolle(n): ${autoroleArray.map((r) => `<@&${r}>`).join(', ')}`: ''}`", "error25": "`\\`🚫\\` **${channel.toString()}** ist kein Textkanal.`", - "error26": "`🚫` Sie können keine Kategorie als Protokollkanal zuweisen.", + "error26": "`🚫` Sie können diesen Typ von Serverkanal nicht zuweisen, geben Sie bitte einen Textkanal an.", "error27": "`🚫` Sie haben keine Berechtigung, den Slowmode für diesen Kanal festzulegen.", "error28": "`🚫` Dieser Benutzer ist nicht von diesem Server gesperrt.", "error29": "`🚫` Dieser Kanal ist bereits entsperrt.", @@ -696,6 +746,7 @@ "error50": "`\\`🚫\\` Ungültige Farbe.\n\n> Bitte verwenden Sie einen hexadezimalen Farbcode.\n\n> Zum Beispiel: \\`#ff0000\\``", "error51": "`\\`🚫\\` Eine meiner Rollen muss über ${roleAR.toString()} sein, um diese Aktion auszuführen.\n\n> Sie können dies in \\`Servereinstellungen -> Rollen\\``", "error52": "`\\`🚫\\` Ich benötige die Berechtigung(en) \\`${requiredPerms.join(', ')}\\`, um diese Aktion auszuführen.\n\n> Sie können dies in \\`Servereinstellungen -> Rollen\\``", - "error53": "`🚫` Ich benötige die Berechtigung(en) `SendMessages, EmbedLinks`, um diese Aktion zu protokollieren.\n\n> Sie können dies in `Servereinstellungen -> Rollen`" + "error53": "`🚫` Ich benötige die Berechtigung(en) `SendMessages, EmbedLinks`, um diese Aktion zu protokollieren.\n\n> Sie können dies in `Servereinstellungen -> Rollen`", + "error54": "`🚫` Die Verifizierungsrolle ist nicht festgelegt!\nBitte kontaktieren Sie einen Administrator dieses Servers." } } diff --git a/src/languages/en.json b/src/languages/en.json index b310d0a..a8f1c7b 100644 --- a/src/languages/en.json +++ b/src/languages/en.json @@ -142,6 +142,16 @@ "description": "If a message is edited by a user." } } + }, + "verify": { + "reply": "`\\`🔎\\` Verification channel is now set in ${channel.toString()}.\\n\\n> **Note:** I have created ${verifyRole.toString()} role.\\n> You can change this role to your liking. *\\`ViewChannel\\` permission is mandatory*\\n> It is not advisable to use the 'Auto Role' feature along with this one.`", + "roleName": "Verified", + "embed1": { + "title": "Verification", + "description": "Press the button below to verify yourself." + }, + "button1": "Verify", + "button2": "Edit" } }, "blacklist": { @@ -438,6 +448,23 @@ "reply": "`\\`✅\\` JTC channel names have been reset to:\n> ${defaultNames.join(',\\n> ')}`" } }, + "verify": { + "reply1": "`✅` You are now verified!", + "reply2": "`🔎` You can choose to use a captcha or not.\n\n> A captcha is a **randomized code** that the newcomers must enter to **verify themselves**.\n> If you don't want to use a captcha, the newcomers will simply be **verified by clicking on the button**.", + "alreadyVerified": "`❎` You are already verified.", + "embed1": { + "title": "Verification", + "description": "Please enter the following code\n with the button below to verify yourself.", + "field1": "Code" + }, + "button1": "I'm not a robot", + "button2": "Enable captcha", + "button3": "Disable", + "modal1": { + "title": "Confirm your identity", + "field1": "Verification code" + } + }, "logsTypes": { "select1": { "title": "What logs do you want to see?", @@ -476,6 +503,10 @@ }, "delDcInv": { "reply": "`🔗` Discord links suppressor is now enabled ✅\n\n> You can re-run your command" + }, + "verifyCaptcha": { + "reply1": "`🔎` Captcha verification is enabled ✅\n\n> It will now prompt the user to enter a randomized code when they join the server.", + "reply2": "`🔎` Captcha verification is disabled ❎\n\n> It will simply give the role to the newcomer." } }, "roleclaim": { @@ -527,14 +558,18 @@ "description": "OPTIONAL - Give roles to newcomers" }, "option5": { - "label": "Blacklist", - "description": "OPTIONAL - Protect your server against bots, scams, etc." + "label": "Verify", + "description": "OPTIONAL - Verify newcomers with a captcha" }, "option6": { + "label": "Blacklist", + "description": "OPTIONAL - Timeout freshly new accounts created" + }, + "option7": { "label": "Moderation Tools", "description": "OPTIONAL - Enable or disable moderation features" }, - "option7": { + "option8": { "label": "Language", "description": "OPTIONAL - Change the language of the bot" } @@ -564,6 +599,11 @@ }, "roleclaimEmbed": { "reply": "`✅` Roleclaim message updated." + }, + "verify": { + "reply": "`✅` You are now verified!", + "badCode": "`❎` Invalid code.\nPlease try again.", + "alreadyVerified": "`❎` You are already verified." } }, "selectMenus": { @@ -574,14 +614,16 @@ "msgEdit": "\n`✍` *Message edits*", "joinLeave": "\n`🚪` *Join & Leave*", "moderation": "\n`🛡️` *Moderation*", - "channels": "\n`📙` *Channels*" + "channels": "\n`📙` *Channels*", + "verifyCaptcha": "\n`🔎` *Verification Captcha*" } }, "moderationTools": { "reply": "`**Moderation tools enabled:**${!spelledValues ? ' ❎' : spelledValues}`", "spelledValues": { "blacklist": "\n`🛡️` *Blacklist*", - "delDcInv": "\n`🔗` *Discord links suppressor*" + "delDcInv": "\n`🔗` *Discord links suppressor*", + "verifyCaptcha": "\n`🔎` *Verification Captcha*" } }, "setupLanguageThird": { @@ -595,11 +637,12 @@ } }, "channels": { - "reply": "`${logsChannel ? `> **\\`🚀\\` Logs** channel is setup in <#${logsChannel}>. \n`: ''} ${roleclaimChannel ? `> **\\`🗂️\\` Role claim** channel is setup in <#${roleclaimChannel}>. \n`: ''} ${membercountChannel ? `> **\\`🧾\\` Member count** channel is setup in **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'default'}** category. \n`: ''} ${JTCChannel ? `> **\\`🔊\\` Join to Create** channel is setup in **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'default'}** category. \n`: ''}\n\\`🚀\\` Please use, \\`/setup channels\\` command to setup your channels.`", + "reply": "`${logsChannel ? `> **\\`🚀\\` Logs** channel is setup in <#${logsChannel}>. \n`: ''} ${verifyChannel ? `> **\\`🔎\\` Verify** message is setup in <#${verifyChannel}>.\n` : ''} ${roleclaimChannel ? `> **\\`🗂️\\` Role claim** channel is setup in <#${roleclaimChannel}>. \n`: ''} ${membercountChannel ? `> **\\`🧾\\` Member count** channel is setup in **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'default'}** category. \n`: ''} ${JTCChannel ? `> **\\`🔊\\` Join to Create** channel is setup in **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'default'}** category. \n`: ''}\n\\`🚀\\` Please use, \\`/setup channels\\` command to setup your channels.\n\\`🔎\\` You can disable the captcha and just give the role, use 'Moderation Tools' option in the \\`/setup menu\\`.`", "button1": "Setup Logs", "button2": "Edit Role Claim message", "button3": "Rename Member Count", - "button4": "Edit Join to Create names" + "button4": "Edit Join to Create names", + "button5": "Edit verify feature" }, "jtc": { "reply1": "`\\`🔊\\` **Join to Create** is a feature that **cleans up the voice channel space**, by making use of a **single channel to generate new voice channels**.\n\n> JTC channel ${findChannel.toString()} is currently setup in **${findChannel.parent ? findChannel.parent.toString() : 'default'}** category.\n\nPlease use the **buttons below** to **edit** this feature.`", @@ -634,8 +677,16 @@ "option2": { "label": "Discord invites suppressor", "description": "Automatically deletes invitations sent by non-moderators" + }, + "option3": { + "label": "Verification captcha", + "description": "A captcha will be requested for the verify feature." } } + }, + "verify": { + "reply": "`\\`🔎\\` Verification system **protect your server** from possible raids and scams, by forcing newcomers to **fill a captcha** or to click on a button according to your preferences.\\n\\n \\`⚠️\\` it is not recommended to use the **Auto Role** system along with this one.\nUse \\`/setup channels\\` to set it up.${\r\n verifyMsg\r\n ? `\\n\\n> Verification system is currently setup in ${verifyCnl.toString()}.${\r\n fetchGuild.moderationTools.enabled.includes(\"verifyCaptcha\")\r\n ? \"\\n> Captcha is **enabled**.\"\r\n : \"\\n> Captcha is **disabled**.\"\r\n }`\r\n : \"\"\r\n}`", + "button1": "Edit" } } } @@ -666,7 +717,7 @@ "error23": "`🚫` No autorole set.\n\n> Set one with `/setup autorole add`", "error24": "`\\`🚫\\` ${roleAR.toString()} is not in the list.${moreThanOneRole? `\n\n> Role(s): ${autoroleArray.map((r) => `<@&${r}>`).join(', ')}`: ''}`", "error25": "`\\`🚫\\` **${channel.toString()}** is not a text channel.`", - "error26": "`🚫` You can't assign a category as a logs channel.", + "error26": "`🚫` You can't assign this type of guild channel, please provide a text channel.", "error27": "`🚫` You don't have permission to set the slowmode for this channel.", "error28": "`🚫` This user is not banned from this server.", "error29": "`🚫` This channel is already unlocked.", @@ -693,6 +744,7 @@ "error50": "`\\`🚫\\` Invalid color.\n\n> Please use a hexadecimal color code.\n\n> For example: \\`#ff0000\\``", "error51": "`\\`🚫\\` One of my roles need to be above ${roleAR.toString()} to perform this action.\n\n> You can do this in \\`server settings -> roles\\``", "error52": "`\\`🚫\\` I need \\`${requiredPerms.join(', ')}\\` permission(s) to perform this action.\n\n> You can do this in \\`server settings -> roles\\``", - "error53": "`🚫` I need `SendMessages, EmbedLinks` permission(s) to log this action.\n\n> You can do this in `server settings -> roles`" + "error53": "`🚫` I need `SendMessages, EmbedLinks` permission(s) to log this action.\n\n> You can do this in `server settings -> roles`", + "error54": "`🚫` The verification role is not set!\nPlease contact an administrator of this server." } } diff --git a/src/languages/es.json b/src/languages/es.json index f119289..8881607 100644 --- a/src/languages/es.json +++ b/src/languages/es.json @@ -142,6 +142,16 @@ "description": "Si un mensaje es editado por un usuario." } } + }, + "verify": { + "reply": "`\\`🔎\\` El canal de verificación ahora está configurado en ${channel.toString()}.\\n\\n> **Nota:** He creado el rol ${verifyRole.toString()}.\\n> Puedes cambiar este rol a tu gusto. *\\`ViewChannel\\` permiso es obligatorio*\\n> No es recomendable usar la función 'Auto Role' junto con esta.`", + "roleName": "Verificado", + "embed1": { + "title": "Verificación", + "description": "Presiona el botón de abajo para verificarte." + }, + "button1": "Verificar", + "button2": "Editar" } }, "blacklist": { @@ -438,6 +448,23 @@ "reply": "`\\`✅\\` Los nombres de los canales JTC se han restablecido a:\n> ${defaultNames.join(',\\n> ')}`" } }, + "verify": { + "reply1": "`✅` ¡Ahora estás verificado!", + "reply2": "`🔎` Puedes elegir usar un captcha o no.\n\n> Un captcha es un **código aleatorio** que los nuevos miembros deben ingresar para **verificarse**.\n> Si no quieres usar un captcha, los nuevos miembros simplemente serán **verificados al hacer clic en el botón**.", + "alreadyVerified": "`❎` Ya estás verificado.", + "embed1": { + "title": "Verificación", + "description": "Por favor ingrese el siguiente código\n con el botón de abajo para verificarse.", + "field1": "Código" + }, + "button1": "No soy un robot", + "button2": "Habilitar captcha", + "button3": "Deshabilitar", + "modal1": { + "title": "Confirma tu identidad", + "field1": "Código de verificación" + } + }, "logsTypes": { "select1": { "title": "¿Qué registros quieres ver?", @@ -476,6 +503,10 @@ }, "delDcInv": { "reply": "`🔗` Supresor de enlaces de Discord ahora está habilitado ✅\n\n> Puedes volver a ejecutar tu comando" + }, + "verifyCaptcha": { + "reply1": "`🔎` La verificación de captcha está habilitada ✅\n\n> Ahora le pedirá al usuario que ingrese un código aleatorio cuando se una al servidor.", + "reply2": "`🔎` La verificación de captcha está deshabilitada ❎\n\n> Simplemente le dará el rol al recién llegado." } }, "roleclaim": { @@ -527,14 +558,18 @@ "description": "OPCIONAL - Da roles a los nuevos miembros" }, "option5": { - "label": "Blacklist", - "description": "OPCIONAL - Protege tu servidor contra bots, estafas, etc." + "label": "Verificar", + "description": "OPCIONAL - Verifica a los nuevos miembros con un captcha" }, "option6": { + "label": "Blacklist", + "description": "OPCIONAL - Excluye temporalmente las nuevas cuentas" + }, + "option7": { "label": "Herramientas de moderación", "description": "OPCIONAL - Habilita o deshabilita funciones de moderación" }, - "option7": { + "option8": { "label": "Idioma", "description": "OPCIONAL - Cambia el idioma del bot" } @@ -564,6 +599,11 @@ }, "roleclaimEmbed": { "reply": "`✅` Mensaje de reclamación de rol actualizado." + }, + "verify": { + "reply": "`✅` ¡Ahora estás verificado!", + "badCode": "`❎` Código inválido.\nPor favor, inténtalo de nuevo.", + "alreadyVerified": "`❎` Ya estás verificado." } }, "selectMenus": { @@ -574,14 +614,16 @@ "msgEdit": "\n`✍` *Edición de mensajes*", "joinLeave": "\n`🚪` *Entrada y salida*", "moderation": "\n`🛡️` *Moderación*", - "channels": "\n`📙` *Canales*" + "channels": "\n`📙` *Canales*", + "verifyCaptcha": "\n`🔎` *Verificación Captcha*" } }, "moderationTools": { "reply": "`**Herramientas de moderación habilitadas:**${!spelledValues ? ' ❎' : spelledValues}`", "spelledValues": { "blacklist": "\n`🛡️` *Blacklist*", - "delDcInv": "\n`🔗` *Supresor de enlaces de Discord*" + "delDcInv": "\n`🔗` *Supresor de enlaces de Discord*", + "verifyCaptcha": "\n`🔎` *Verificación Captcha*" } }, "setupLanguageThird": { @@ -595,11 +637,12 @@ } }, "channels": { - "reply": "`${logsChannel ? `> **\\`🚀\\` Logs** canal está configurado en <#${logsChannel}>. \n`: ''} ${roleclaimChannel ? `> **\\`🗂️\\` Role Claim** canal está configurado en <#${roleclaimChannel}>. \n`: ''} ${membercountChannel ? `> **\\`🧾\\` Member count** canal está configurado en **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'default'}** categoría. \n`: ''} ${JTCChannel ? `> **\\`🔊\\` Join to Create** canal está configurado en **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'default'}** categoría. \n`: ''}\n\\`🚀\\` Por favor usa, el comando \\`/setup canales\\` para configurar tus canales.`", + "reply": "`${logsChannel ? `> **\\`🚀\\` Logs** canal está configurado en <#${logsChannel}>. \n`: ''} ${verifyChannel ? `> **\\`🔎\\` Verificar** mensaje está configurado en <#${verifyChannel}>.\n` : ''} ${roleclaimChannel ? `> **\\`🗂️\\` Reclamar rol** canal está configurado en <#${roleclaimChannel}>. \n`: ''} ${membercountChannel ? `> **\\`🧾\\` Contador de miembros** canal está configurado en **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'default'}** categoría. \n`: ''} ${JTCChannel ? `> **\\`🔊\\` Unirse para crear** canal está configurado en **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'default'}** categoría. \n`: ''}\n\\`🚀\\` Por favor usa, el comando \\`/setup canales\\` para configurar tus canales.\n\\`🔎\\` Puedes deshabilitar el captcha y solo dar el rol, usa la opción 'Herramientas de moderación' en el \\`/setup menu\\`.`", "button1": "Configurar Logs", "button2": "Editar mensaje de reclamación de rol", "button3": "Renombrar Member Count", - "button4": "Editar nombres de Join to Create" + "button4": "Editar nombres de Join to Create", + "button5": "Editar verificación" }, "jtc": { "reply1": "`\\`🔊\\` **Join to Create** es una característica que **limpia el espacio del canal de voz**, haciendo uso de un **único canal para generar nuevos canales de voz**.\n\n> El canal JTC ${findChannel.toString()} está actualmente configurado en la categoría **${findChannel.parent ? findChannel.parent.toString() : 'default'}**.\n\nPor favor usa los **botones de abajo** para **editar** esta característica.`", @@ -634,8 +677,16 @@ "option2": { "label": "Supresor de invitaciones de Discord", "description": "Elimina automáticamente las invitaciones enviadas por no moderadores" + }, + "option3": { + "label": "Captcha de verificación", + "description": "Se solicitará un captcha para la función de verificación." } } + }, + "verifyES": { + "reply": "`\\`🔎\\` El sistema de verificación **protege tu servidor** de posibles incursiones y estafas, obligando a los nuevos miembros a **rellenar un captcha** o a hacer clic en un botón según tus preferencias.\\n\\n \\`⚠️\\` no se recomienda usar el sistema de **Auto Role** junto con este.\\nUsa \\`/setup canales\\` para configurarlo.${\r\n verifyMsg\r\n ? `\\n\\n> El sistema de verificación está actualmente configurado en ${verifyCnl.toString()}.${\r\n fetchGuild.moderationTools.enabled.includes(\"verifyCaptcha\")\r\n ? \"\\n> Captcha está **activado**.\"\r\n : \"\\n> Captcha está **desactivado**.\"\r\n }`\r\n : \"\"\r\n}`", + "button1": "Editar" } } } @@ -666,7 +717,7 @@ "error23": "`🚫` No hay autorole establecido.\n\n> Establece uno con `/setup autorole añadir`", "error24": "`\\`🚫\\` ${roleAR.toString()} no está en la lista.${moreThanOneRole? `\n\n> Rol(es): ${autoroleArray.map((r) => `<@&${r}>`).join(', ')}`: ''}`", "error25": "`\\`🚫\\` **${channel.toString()}** no es un canal de texto.`", - "error26": "`🚫` No puedes asignar una categoría como canal de registros.", + "error26": "`🚫` No puedes asignar este tipo de canal de servidor, proporciona un canal de texto.", "error27": "`🚫` No tienes permiso para establecer el slowmode para este canal.", "error28": "`🚫` Este usuario no está baneado de este servidor.", "error29": "`🚫` Este canal ya está desbloqueado.", @@ -693,6 +744,7 @@ "error50": "`\\`🚫\\` Color inválido.\n\n> Usa un código de color hexadecimal.\n\n> Por ejemplo: \\`#ff0000\\``", "error51": "`\\`🚫\\` Uno de mis roles necesita estar por encima de ${roleAR.toString()} para realizar esta acción.\n\n> Puedes hacer esto en \\`configuración del servidor -> roles\\``", "error52": "`\\`🚫\\` Necesito \\`${requiredPerms.join(', ')}\\` permiso(s) para realizar esta acción.\n\n> Puedes hacer esto en \\`configuración del servidor -> roles\\``", - "error53": "`🚫` Necesito `SendMessages, EmbedLinks` permiso(s) para registrar esta acción.\n\n> Puedes hacer esto en `configuración del servidor -> roles`" + "error53": "`🚫` Necesito `SendMessages, EmbedLinks` permiso(s) para registrar esta acción.\n\n> Puedes hacer esto en `configuración del servidor -> roles`", + "error54": "`🚫` ¡El rol de verificación no está configurado!\nPor favor, póngase en contacto con un administrador de este servidor." } } diff --git a/src/languages/fr.json b/src/languages/fr.json index 769740c..89d6180 100644 --- a/src/languages/fr.json +++ b/src/languages/fr.json @@ -141,6 +141,26 @@ "description": "Si un message est édité par un utilisateur." } } + }, + "verify": { + "reply": "`\\`🔎\\` Verification channel is now set in ${channel.toString()}.\\n\\n> **Note:** I have created ${verifyRole.toString()} role.\\n> You can change this role to your liking. *\\`ViewChannel\\` permission is mandatory*\\n> It is not advisable to use the 'Auto Role' feature along with this one.`", + "roleName": "Verified", + "embed1": { + "title": "Verification", + "description": "Press the button below to verify yourself." + }, + "button1": "Verify", + "button2": "Edit" + }, + "verifyFr": { + "reply": "`\\`🔎\\` Le channel de vérification est maintenant configuré dans ${channel.toString()}.\\n\\n> **Note:** J'ai créé le rôle ${verifyRole.toString()}.\\n> Vous pouvez le modifier à votre guise. *La permission \\`ViewChannel\\` est obligatoire*\\n> Il n'est pas conseillé d'utiliser la fonctionnalité 'Auto Role' avec celle-ci.`", + "roleName": "Vérifié", + "embed1": { + "title": "Vérification", + "description": "Appuyez sur le bouton ci-dessous pour être vérifié." + }, + "button1": "Vérifier", + "button2": "Modifier" } }, "blacklist": { @@ -441,6 +461,23 @@ }, "resetNames": { "reply": "`\\`✅\\` Les noms des salons JTC ont été réinitialisés par:\n> ${defaultNames.join(',\\n> ')}`" + }, + "verify": { + "reply1": "`✅` Vous êtes maintenant vérifié!", + "reply2": "`🔎` Vous pouvez choisir d'utiliser un captcha ou non.\n\n> Un captcha est un **code aléatoire** que les nouveaux arrivants doivent entrer pour **se vérifier**.\n> Si vous ne souhaitez pas utiliser de captcha, les nouveaux arrivants seront simplement **vérifiés en cliquant sur le bouton**.", + "alreadyVerified": "`❎` Vous êtes déjà vérifié.", + "embed1": { + "title": "Verification", + "description": "Veuillez entrer le code suivant\n avec le bouton ci-dessous pour vous vérifier.", + "field1": "Code" + }, + "button1": "Je ne suis pas un robot", + "button2": "Activer le captcha", + "button3": "Désactiver", + "modal1": { + "title": "Confirmez votre identité", + "field1": "Code de vérification" + } } }, "logsTypes": { @@ -481,6 +518,10 @@ }, "delDcInv": { "reply": "`🔗` Le nettoyeur de liens discord est maintenant activé ✅\n\n> Vous pouvez ré-exécuter votre commande" + }, + "verifyCaptcha": { + "reply1": "`🔎` La vérification par captcha est activée ✅\n\n> Elle demandera désormais à l'utilisateur d'entrer un code aléatoire lorsqu'il rejoint le serveur.", + "reply2": "`🔎` La vérification par captcha est désactivée ❎\n\n> Elle donnera simplement le rôle au nouveau venu." } }, "roleclaim": { @@ -532,14 +573,18 @@ "description": "OPTIONNEL - Rôles automatiques pour les nouveaux arrivants" }, "option5": { - "label": "Blacklist", - "description": "OPTIONNEL - Protégez votre serveur contre les bots, arnaques, etc." + "label": "Vérification", + "description": "OPTIONNEL - Vérifiez les nouveaux arrivants avec un captcha" }, "option6": { + "label": "Blacklist", + "description": "OPTIONNEL - Exclure temporairement les nouveaux comptes" + }, + "option7": { "label": "Moderation Tools", "description": "OPTIONNEL - Activez ou désactivez les fonctionnalités de modération" }, - "option7": { + "option8": { "label": "Langue", "description": "OPTIONNEL - Changez la langue du bot" } @@ -569,6 +614,11 @@ }, "roleclaimEmbed": { "reply": "`✅` Message du 'Role Claim' mis à jour." + }, + "verify": { + "reply": "`✅` Vous êtes maintenant vérifié !", + "badCode": "`❎` Code invalide.\nVeuillez réessayer.", + "alreadyVerified": "`❎` Vous êtes déjà vérifié." } }, "selectMenus": { @@ -579,14 +629,16 @@ "msgEdit": "\n`✍` *Édition de messages*", "joinLeave": "\n`🚪` *Arrivée & Départ*", "moderation": "\n`🛡️` *Modération*", - "channels": "\n`📙` *Salons*" + "channels": "\n`📙` *Salons*", + "verifyCaptcha": "\n`🔎` *Vérification par captcha*" } }, "moderationTools": { "reply": "`**Outils de modération activés:**${!spelledValues ? ' ❎' : spelledValues}`", "spelledValues": { "blacklist": "\n`🛡️` *Blacklist*", - "delDcInv": "\n`🔗` *Nettoyeur de liens Discord*" + "delDcInv": "\n`🔗` *Nettoyeur de liens Discord*", + "verifyCaptcha": "\n`🔎` *Vérification par captcha*" } }, "setupLanguageThird": { @@ -600,11 +652,12 @@ } }, "channels": { - "reply": "`${logsChannel ? `> Le salon **\\`🚀\\` Logs** est configuré dans <#${logsChannel}>. \n`: ''} ${roleclaimChannel ? `> Le salon **\\`🗂️\\` Role claim** est configuré dans <#${roleclaimChannel}>. \n`: ''} ${membercountChannel ? `> Le salon **\\`🧾\\` Member count** est configuré dans la catégorie **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'par défaut'}**. \n`: ''} ${JTCChannel ? `> Le salon **\\`🔊\\` Join to Create** est configuré dans la catégorie **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'par défaut'}**. \n`: ''}\n\\`🚀\\` Veuillez utiliser, la commande \\`/setup salons\\` pour configurer vos salons.`", - "button1": "Configurer Logs", + "reply": "`${logsChannel ? `> Le salon **\\`🚀\\` Logs** est configuré dans <#${logsChannel}>. \n`: ''} ${verifyChannel ? `> Le message de **\\`🔎\\` Verification** est configuré dans <#${verifyChannel}>.\n` : ''} ${roleclaimChannel ? `> Le salon **\\`🗂️\\` Role claim** est configuré dans <#${roleclaimChannel}>. \n`: ''} ${membercountChannel ? `> Le salon **\\`🧾\\` Member count** est configuré dans la catégorie **${membercountChannel.parent ? `<#${membercountChannel.parentId}>`: 'default'}**. \n`: ''} ${JTCChannel ? `> Le salon **\\`🔊\\` Join to Create** est configuré dans la catégorie **${JTCChannel.parent ? `<#${JTCChannel.parentId}>` : 'default'}**. \n`: ''}\n\\`🚀\\` Veuillez utiliser la commande, \\`/setup channels\\` pour configurer vos salons.\n\\`🔎\\` Vous pouvez désactiver le captcha et juste donner le rôle, utilisez l'option 'Moderation Tools' dans la commande \\`/setup menu\\`.`", + "button1": "Configurer les Logs", "button2": "Modifier le message du Role Claim", "button3": "Renommer le Member Count", - "button4": "Modifier les noms du Join to Create" + "button4": "Modifier les noms du Join to Create", + "button5": "Modifier la vérification" }, "jtc": { "reply1": "`\\`🔊\\` **Join to Create** est une fonctionnalité qui **libère de l'espace sur le serveur**, en utilisant un **seul salon pour générer de nouveaux salons vocaux**.\n\n> Le salon JTC ${findChannel.toString()} est actuellement configuré dans la catégorie **${findChannel.parent ? findChannel.parent.toString() : 'par défaut'}**.\n\nVeuillez utiliser les **boutons ci-dessous** pour **modifier** cette fonctionnalité.`", @@ -639,8 +692,16 @@ "option2": { "label": "Nettoyeur d'invitations Discord", "description": "Supprime automatiquement les invitations envoyées par des non-modérateurs" + }, + "option3": { + "label": "Verification captcha", + "description": "Un captcha sera demandé pour la fonctionnalité de vérification." } } + }, + "verify": { + "reply": "`\\`🔎\\` Le système de vérification **protège votre serveur** contre les éventuels raids et escroqueries, en obligeant les nouveaux arrivants à **remplir un captcha** ou à cliquer sur un bouton selon vos préférences.\\n\\n \\`⚠️\\` il n'est pas recommandé d'utiliser le **système d'attribution automatique de rôles** avec celui-ci.\nUtilisez \\`/setup channels\\` pour le configurer.${\r\n verifyMsg\r\n ? `\\n\\n> Le système de vérification est actuellement configuré dans ${verifyCnl.toString()}.${\r\n fetchGuild.moderationTools.enabled.includes(\"verifyCaptcha\")\r\n ? \"\\n> Le captcha est **activé**.\"\r\n : \"\\n> Le captcha est **désactivé**.\"\r\n }`\r\n : \"\"\r\n}`", + "button1": "Modifier" } } } @@ -671,7 +732,7 @@ "error23": "`🚫` Aucun autorole défini.\n\n> Définissez-en un avec `/setup autorole ajouter`", "error24": "`\\`🚫\\` ${roleAR.toString()} n'est pas dans la liste.${moreThanOneRole? `\n\n> Rôle(s): ${autoroleArray.map((r) => `<@&${r}>`).join(', ')}`: ''}`", "error25": "`\\`🚫\\` **${channel.toString()}** n'est pas un salon de texte.`", - "error26": "`🚫` Vous ne pouvez pas assigner une catégorie comme salon de logs.", + "error26": "`🚫` Vous ne pouvez pas assigner ce type de salon de serveur, veuillez fournir un salon de texte.", "error27": "`🚫` Vous n'avez pas la permission de définir le slowmode pour ce salon.", "error28": "`🚫` Cet utilisateur n'est pas banni sur ce serveur.", "error29": "`🚫` Ce salon est déjà déverrouillé.", @@ -698,6 +759,7 @@ "error50": "`\\`🚫\\` Couleur invalide.\n\n> Veuillez utiliser un code couleur hexadécimal.\n\n> Par exemple: \\`#ff0000\\``", "error51": "`\\`🚫\\` Un de mes rôles doit être au-dessus de ${roleAR.toString()} pour effectuer cette action.\n\n> Vous pouvez le faire dans \\`paramètres du serveur -> rôles\\``", "error52": "`\\`🚫\\` J'ai besoin de la permission \\`${requiredPerms.join(', ')}\\` pour effectuer cette action.\n\n> Vous pouvez le changer dans \\`paramètres du serveur -> rôles\\``", - "error53": "`🚫` J'ai besoin de la permission `SendMessages, EmbedLinks` pour enregistrer cette action.\n\n> Vous pouvez le faire dans `paramètres du serveur -> rôles`" + "error53": "`🚫` J'ai besoin de la permission `SendMessages, EmbedLinks` pour enregistrer cette action.\n\n> Vous pouvez le faire dans `paramètres du serveur -> rôles`", + "error54": "`🚫` Le rôle de vérification n'est pas défini!\nVeuillez contacter un administrateur de ce serveur." } } diff --git a/src/util/functions.js b/src/util/functions.js index 6303e10..b1370be 100644 --- a/src/util/functions.js +++ b/src/util/functions.js @@ -16,14 +16,14 @@ require("dotenv").config(); const dayjs = require("dayjs"); const nodeEmoji = require("node-emoji"); const { Guild } = require("../db-model"); -const { rando } = require("@nastyox/rando.js"); +const { rando, randoSequence } = require("@nastyox/rando.js"); // This file contains all the functions that are used in the bot to avoid code duplication. module.exports = (client) => { /* This function is used to create a new embed. */ client.Embed = (color = true) => { let embed = new EmbedBuilder(); - if (color) embed.setColor("#508fb0"); + if (color) embed.setColor("#2f3136"); return embed; }; @@ -173,6 +173,14 @@ module.exports = (client) => { return rando(arr).value; }; + /* This function is used to return a random sequence from an array. */ + client.GenerateCaptcha = async () => { + const randomTab = randoSequence( + "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" + ); + return randomTab.splice(0, 5).join(""); + }; + /* This function is used to get the name of an emoji from its unicode. */ client.GetEmojiNameFromUni = (unicodeEmoji) => { return nodeEmoji.find(unicodeEmoji).key; From b784a91b5090b1f8a71491b40593d1444aa66443 Mon Sep 17 00:00:00 2001 From: Pexilo <67436391+Pexilo@users.noreply.github.com> Date: Tue, 11 Oct 2022 14:51:16 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=A7=20PR=20#11=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/admin/setup-Ids.js | 91 ++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 30 deletions(-) diff --git a/src/commands/admin/setup-Ids.js b/src/commands/admin/setup-Ids.js index 594564e..4fda339 100644 --- a/src/commands/admin/setup-Ids.js +++ b/src/commands/admin/setup-Ids.js @@ -66,48 +66,62 @@ module.exports = class SetupBotCommand extends Command { { name: "🚀 Logs channel - track specific user interactions", nameLocalizations: { - fr: "🚀 Salon de logs - Suivre les interactions des utilisateurs", - de: "🚀 Logs-Kanal - Verfolgen Sie bestimmte Benutzerinteraktionen", + fr: + "🚀 Salon de logs - Suivre les interactions des utilisateurs", + de: + "🚀 Logs-Kanal - Verfolgen Sie bestimmte Benutzerinteraktionen", "es-ES": "🚀 Canal de registros - Rastrear interacciones específicas de usuario", }, value: "logs", }, { - name: "🔊 Join to Create channel - set a voice channel creator to free up space", + name: + "🔊 Join to Create channel - set a voice channel creator to free up space", nameLocalizations: { - fr: "🔊 Salon 'Join to Create' - Définir un salon vocal créateur pour libérer de l'espace", - de: "🔊 Join to Create-Kanal - Setzen Sie einen Sprachkanal, um Platz zu schaffen", + fr: + "🔊 Salon 'Join to Create' - Définir un salon vocal créateur pour libérer de l'espace", + de: + "🔊 Join to Create-Kanal - Setzen Sie einen Sprachkanal, um Platz zu schaffen", "es-ES": "🔊 Canal de 'Join to Create' - Establece un canal de voz para crear espacio", }, value: "jtc", }, { - name: "🎈 Role Claim channel - allow users to choose a role with a reaction", + name: + "🎈 Role Claim channel - allow users to choose a role with a reaction", nameLocalizations: { - fr: "🎈 Salon 'Role Claim' - Permettre aux utilisateurs de choisir un rôle avec une réaction", - de: "🎈 Role Claim-Kanal - Benutzern erlauben, eine Rolle mit einer Reaktion auszuwählen", + fr: + "🎈 Salon 'Role Claim' - Permettre aux utilisateurs de choisir un rôle avec une réaction", + de: + "🎈 Role Claim-Kanal - Benutzern erlauben, eine Rolle mit einer Reaktion auszuwählen", "es-ES": "🎈 Canal de 'Role Claim' - Permitir a los usuarios elegir un rol con una reacción", }, value: "roleclaim", }, { - name: "🧾 Member Count channel - allow users to see the member count of the server", + name: + "🧾 Member Count channel - allow users to see the member count of the server", nameLocalizations: { - fr: "🧾 Salon 'Member Count' - Permettre aux utilisateurs de voir le nombre de membres du serveur", - de: "🧾 Member Count-Kanal - Benutzern erlauben, die Mitgliederzahl des Servers anzuzeigen", + fr: + "🧾 Salon 'Member Count' - Permettre aux utilisateurs de voir le nombre de membres du serveur", + de: + "🧾 Member Count-Kanal - Benutzern erlauben, die Mitgliederzahl des Servers anzuzeigen", "es-ES": "🧾 Canal de 'Member Count' - Permitir a los usuarios ver la cantidad de miembros del servidor", }, value: "membercount", }, { - name: "🔎 Verify channel - allow users to verify themselves with a captcha", + name: + "🔎 Verify channel - allow users to verify themselves with a captcha", nameLocalizations: { - fr: "🔎 Salon 'Verify' - Permettre aux utilisateurs de se vérifier eux-mêmes avec un captcha", - de: "🔎 Verify-Kanal - Benutzern erlauben, sich selbst mit einem Captcha zu verifizieren", + fr: + "🔎 Salon 'Verify' - Permettre aux utilisateurs de se vérifier eux-mêmes avec un captcha", + de: + "🔎 Verify-Kanal - Benutzern erlauben, sich selbst mit einem Captcha zu verifizieren", "es-ES": "🔎 Canal de 'Verify' - Permitir a los usuarios verificarse a sí mismos con un captcha", }, @@ -158,20 +172,26 @@ module.exports = class SetupBotCommand extends Command { required: true, choices: [ { - name: "⌚ Blacklist time - change how long the bot will block the newcomer for", + name: + "⌚ Blacklist time - change how long the bot will block the newcomer for", nameLocalizations: { - fr: "⌚ Temps de liste noire - changer la durée pendant laquelle le bot bloquera le nouveau membre", - de: "⌚ Blacklist-Zeit - Ändern Sie die Dauer, für die der Bot den Neuling blockiert", + fr: + "⌚ Temps de liste noire - changer la durée pendant laquelle le bot bloquera le nouveau membre", + de: + "⌚ Blacklist-Zeit - Ändern Sie die Dauer, für die der Bot den Neuling blockiert", "es-ES": "⌚ Tiempo de blacklist - cambia cuánto tiempo bloqueará el bot al nuevo miembro", }, value: "blacklist_time", }, { - name: "🎣 Minimum account age - change the minimum age a newcomer must be to join the server", + name: + "🎣 Minimum account age - change the minimum age a newcomer must be to join the server", nameLocalizations: { - fr: "🎣 Âge minimum du compte - changer l'âge minimum qu'un nouveau membre doit avoir", - de: "🎣 Mindestalter des Kontos - Ändern Sie das Mindestalter, das ein Neuling haben muss", + fr: + "🎣 Âge minimum du compte - changer l'âge minimum qu'un nouveau membre doit avoir", + de: + "🎣 Mindestalter des Kontos - Ändern Sie das Mindestalter, das ein Neuling haben muss", "es-ES": "🎣 Edad mínima de la cuenta - cambia la edad mínima que debe tener un nuevo miembro", }, @@ -268,7 +288,8 @@ module.exports = class SetupBotCommand extends Command { description: "🧮 Choose the role you want to add", descriptionLocalizations: { fr: "🧮 Choisissez le rôle que vous souhaitez ajouter", - de: "🧮 Wählen Sie die Rolle aus, die Sie hinzufügen möchten", + de: + "🧮 Wählen Sie die Rolle aus, die Sie hinzufügen möchten", "es-ES": "🧮 Elija el rol que desea agregar", }, required: true, @@ -280,8 +301,10 @@ module.exports = class SetupBotCommand extends Command { description: "😄 Choose the emoji you want to use for this role", descriptionLocalizations: { - fr: "😄 Choisissez l'emoji que vous souhaitez utiliser pour ce rôle", - de: "😄 Wählen Sie das Emoji aus, das Sie für diese Rolle verwenden möchten", + fr: + "😄 Choisissez l'emoji que vous souhaitez utiliser pour ce rôle", + de: + "😄 Wählen Sie das Emoji aus, das Sie für diese Rolle verwenden möchten", "es-ES": "😄 Elija el emoji que desea usar para este rol", }, required: true, @@ -298,7 +321,8 @@ module.exports = class SetupBotCommand extends Command { "✍️ Choose the description of this role (optional)", descriptionLocalizations: { fr: "✍️ Choisissez la description de ce rôle (facultatif)", - de: "✍️ Wählen Sie die Beschreibung dieser Rolle aus (optional)", + de: + "✍️ Wählen Sie die Beschreibung dieser Rolle aus (optional)", "es-ES": "✍️ Elija la descripción de este rol (opcional)", }, required: false, @@ -363,8 +387,10 @@ module.exports = class SetupBotCommand extends Command { description: "🎩 Assign automatically roles to a newcomer when they join the server", descriptionLocalizations: { - fr: "🎩 Attribuer automatiquement des rôles à un nouveau membre lorsqu'il rejoint le serveur", - de: "🎩 Weisen Sie neuen Mitgliedern beim Betreten des Servers automatisch Rollen zu", + fr: + "🎩 Attribuer automatiquement des rôles à un nouveau membre lorsqu'il rejoint le serveur", + de: + "🎩 Weisen Sie neuen Mitgliedern beim Betreten des Servers automatisch Rollen zu", "es-ES": "🎩 Asigna automáticamente roles a un recién llegado cuando se une al servidor", }, @@ -380,8 +406,10 @@ module.exports = class SetupBotCommand extends Command { description: "🎩 Assign a new role to a newcomer when they join the server", descriptionLocalizations: { - fr: "🎩 Attribuer un nouveau rôle à un nouveau membre lorsqu'il rejoint le serveur", - de: "🎩 Weisen Sie einem neuen Mitglied beim Betreten des Servers eine neue Rolle zu", + fr: + "🎩 Attribuer un nouveau rôle à un nouveau membre lorsqu'il rejoint le serveur", + de: + "🎩 Weisen Sie einem neuen Mitglied beim Betreten des Servers eine neue Rolle zu", "es-ES": "🎩 Asigna un nuevo rol a un recién llegado cuando se une al servidor", }, @@ -952,6 +980,7 @@ module.exports = class SetupBotCommand extends Command { .catch(() => interaction.editReply(errors.error26)); return; } + if (usage === "membercount") { //permissions check requiredPerms = ["Connect", "ManageRoles"]; @@ -1301,6 +1330,7 @@ module.exports = class SetupBotCommand extends Command { ], }); } + break; case "blacklist": if (!(await this.client.Defer(interaction))) return; @@ -1311,8 +1341,9 @@ module.exports = class SetupBotCommand extends Command { content: eval(errors.error52), }); - const blacklistState = - fetchGuild.moderationTools.enabled.includes("blacklist"); + const blacklistState = fetchGuild.moderationTools.enabled.includes( + "blacklist" + ); if (!blacklistState) { return interaction.editReply({ content: setupIds.blacklist.reply1,