Repository navigation
fix: 封禁用户不再触发验证 - #90
Merged
Merged
Conversation
Banned users were hitting captcha before the blocked_users check, so /ban still started TGuard/hCaptcha and accepted later messages without forwarding them. Check the ban first, reply with a banned notice, and refuse verification callbacks. Co-authored-by: pplulee <hi@pplulee.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/ban之后,被封用户再给 bot 发消息仍会先进入验证流程:弹出 captcha / 消耗 TGuard hCaptcha 额度,通过后提示可以发送,但消息不会转发到话题。原因是用户私聊处理里先跑
_check_captcha,封禁检查排在后面;/ban又会清掉验证状态,所以被封用户会被当成未验证用户重新出题。本次改动:
blocked_users,被封则只回复封禁提示(已配置自定义自动回复则用自定义文案)_check_captcha对已封用户直接返回,不再生成或完成验证/start也只提示已封禁,不再发送欢迎语Fixes #89