Files
Nexumi/apps/bot/src/modules/verification/command-definitions.ts
smueller 04e9ffad28 Enhance verification system with multi-provider support and alt-account detection
- Added support for multiple captcha providers including Google reCAPTCHA (v2 and v3), hCaptcha, and Cloudflare Turnstile.
- Introduced new fields in the verification configuration for selecting captcha providers and enabling alt-account detection.
- Implemented logic to handle verification attempts and flag potential alt accounts based on IP and invite code analysis.
- Updated environment configuration to include necessary keys for captcha providers.
- Enhanced the user interface to allow selection of captcha providers in the verification setup.
- Improved backend handling of verification records to store additional data related to captcha provider usage.
2026-07-23 11:28:58 +02:00

69 lines
2.6 KiB
TypeScript

import { ChannelType } from 'discord.js';
import { applyCommandDescription, applyOptionDescription } from '@nexumi/shared';
import { SlashCommandBuilder } from 'discord.js';
export const verifyCommandData = applyCommandDescription(
new SlashCommandBuilder()
.setName('verify')
.addSubcommand((s) =>
applyCommandDescription(s.setName('setup'), 'verify.setup.description')
.addChannelOption((o) =>
applyOptionDescription(
o.setName('channel').addChannelTypes(ChannelType.GuildText).setRequired(true),
'verify.setup.options.channel'
)
)
.addRoleOption((o) =>
applyOptionDescription(o.setName('verified_role').setRequired(true), 'verify.setup.options.verified_role')
)
.addRoleOption((o) =>
applyOptionDescription(o.setName('unverified_role'), 'verify.setup.options.unverified_role')
)
.addStringOption((o) =>
applyOptionDescription(o.setName('mode'), 'verify.setup.options.mode')
.addChoices(
{ name: 'Button', value: 'BUTTON' },
{ name: 'Captcha', value: 'CAPTCHA' }
)
)
.addStringOption((o) =>
applyOptionDescription(
o.setName('captcha_provider'),
'verify.setup.options.captcha_provider'
).addChoices(
{ name: 'Math', value: 'MATH' },
{ name: 'reCAPTCHA v2', value: 'RECAPTCHA_V2' },
{ name: 'reCAPTCHA v3', value: 'RECAPTCHA_V3' },
{ name: 'hCaptcha', value: 'HCAPTCHA' },
{ name: 'Turnstile', value: 'TURNSTILE' }
)
)
.addIntegerOption((o) =>
applyOptionDescription(o.setName('min_account_age_days'), 'verify.setup.options.min_account_age_days')
.setMinValue(0)
.setMaxValue(365)
)
.addStringOption((o) =>
applyOptionDescription(o.setName('fail_action'), 'verify.setup.options.fail_action')
.addChoices(
{ name: 'Kick', value: 'KICK' },
{ name: 'Ban', value: 'BAN' },
{ name: 'None', value: 'NONE' }
)
)
.addBooleanOption((o) =>
applyOptionDescription(o.setName('alt_detection'), 'verify.setup.options.alt_detection')
)
)
.addSubcommand((s) =>
applyCommandDescription(s.setName('panel'), 'verify.panel.description')
.addChannelOption((o) =>
applyOptionDescription(
o.setName('channel').addChannelTypes(ChannelType.GuildText),
'verify.panel.options.channel'
)
)
),
'verify.description'
);