yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.15k stars 1.5k forks source link

A way to add captcha before commands? #422

Open sidelux opened 6 years ago

sidelux commented 6 years ago

I started to fight game bots in my bot, there is a way to add a captcha that block all other commands until captcha validation? Or another way to do that.

Thanks a lot!

aramisf commented 6 years ago

Do you think that checking if the user is another bot could be helpful?

Something like:

bot.on('message', (msg) => {
  if (msg.from.is_bot) {
    // decide what to do if the sender is a bot
  }
})
sidelux commented 6 years ago

@aramisf The problem is that there are 'userbot'. They use telegram cli to write bots, but are recognized with is_bot to false.

aramisf commented 6 years ago

@sidelux I wasn't aware of that!

Can you reproduce that easily?

If so, would you mind pointing me some directions? I'd like to help discovering if this situation is avoidable.

sidelux commented 6 years ago

I don’t know how to do that, but the best way i think would be captcha or something similar. Often userbots are used to automatize operation so... i can’t think anything else.