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) => {