thing
This commit is contained in:
parent
a288703c62
commit
87228a5348
2 changed files with 31 additions and 1 deletions
30
src/commands/verify.ts
Normal file
30
src/commands/verify.ts
Normal 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
|
||||||
|
};
|
|
@ -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);
|
await ctx.banChatMember(newMember.id);
|
||||||
pendingVerificationUsers.splice(index, 1);
|
pendingVerificationUsers.splice(index, 1);
|
||||||
}
|
}
|
||||||
}, 10000);
|
}, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.on("left_chat_member", (ctx) => {
|
bot.on("left_chat_member", (ctx) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue