From 87228a5348f235ae8a55c70aec7b32f1d01dd245 Mon Sep 17 00:00:00 2001 From: nin0dev Date: Sun, 29 Dec 2024 18:15:59 -0500 Subject: [PATCH] thing --- src/commands/verify.ts | 30 ++++++++++++++++++++++++++++++ src/modules/antiBot.ts | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/commands/verify.ts diff --git a/src/commands/verify.ts b/src/commands/verify.ts new file mode 100644 index 0000000..c2083d1 --- /dev/null +++ b/src/commands/verify.ts @@ -0,0 +1,30 @@ +import { Context } from "telegraf"; +import { Command, CommandTypes } from "../utils/types"; +import { pendingVerificationUsers } from "../modules/antiBot"; + +async function handler(ctx: Context, args: string[]) { + const userId = parseInt(args[0]); + if (isNaN(userId)) { + ctx.reply("who?"); + return; + } + + const pendingUserIndex = pendingVerificationUsers.findIndex((user) => user.user === userId); + if (pendingUserIndex === -1) { + ctx.reply(`user is already verified`); + return; + } + + pendingVerificationUsers.splice(pendingUserIndex, 1); + ctx.reply(`done`); +} + +export const verify: Command = { + name: "verify", + aliases: [], + description: "Force-verify a specific user (a bot or someone that can't do math) (takes an ID)", + type: CommandTypes.Moderation, + modOnly: true, + ownerOnly: false, + handler +}; diff --git a/src/modules/antiBot.ts b/src/modules/antiBot.ts index 4cf48e1..a9c3837 100644 --- a/src/modules/antiBot.ts +++ b/src/modules/antiBot.ts @@ -35,7 +35,7 @@ Simply send the answer to the challenge in chat to get verified. If you do not d await ctx.banChatMember(newMember.id); pendingVerificationUsers.splice(index, 1); } - }, 10000); + }, 60000); }); bot.on("left_chat_member", (ctx) => {