This commit is contained in:
nin0 2024-12-29 18:15:59 -05:00
parent a288703c62
commit 87228a5348
No known key found for this signature in database
2 changed files with 31 additions and 1 deletions

30
src/commands/verify.ts Normal file
View file

@ -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
};

View file

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