You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: critical bugs in guest-bot-block (handler group, restrict loop)
- Move guest_bot_block from float group=0.9 to int group=0 (PTB v20+ requires int)
Fixes: TypeError on bot startup when registering handlers
- Fix restrict failure infinite loop: change threshold check from < to !=
Was: if fresh.message_count < threshold → always retries on failure
Now: if fresh.message_count != threshold → only restricts at exact threshold
Fixes: Looping restrict_chat_member calls when API fails
- Extend captcha lock through DB finalization, call mark_all_bot_restrictions_unrestricted
Serializes Telegram unrestrict + DB state transition per lock contract
Handles nested exception: ApplicationHandlerStop propagates to outer handler
- Add try/except for restrict_chat_member failures (increment counter on failure)
Prevents counter desync when restriction API calls fail
- Code quality: drop redundant None check, simplify whitelist normalization
- Tests: update expected handler group (0 instead of 0.9), manifest order assertion
- Types: revert PluginManifest to str|int (no float needed with group=0)
All 1075 tests passing, 97% coverage, ruff/mypy clean.
0 commit comments