GreenCaptchaBot icon indicating copy to clipboard operation
GreenCaptchaBot copied to clipboard

Bot may prolong the temporary restrictions after user entering the right captcha

Open ForNeVeR opened this issue 3 years ago • 0 comments

Consider the following scenario.

  1. The user has been temporarily restricted in the chat.
  2. The user has left the chat.
  3. The user has re-entered the chat, and has been muted by the bot.
  4. The user has entered the right captcha.

After that, this code will restore the user permissions from step 1, but will prolong them forever (i.e. won't set a restrictUntil date): https://github.com/ImoutoChan/GreenCaptchaBot/blob/3efc1124bc662ea16b890b93591f8179a094b8f8/CaptchaBot/Services/WelcomeService.cs#L92-L95

I propose this code to restore the restriction date (if available in preBanPermissions), too.

ForNeVeR avatar Feb 28 '21 09:02 ForNeVeR