Skip to content

Fix silent ban-user skips on unjoined channels, thread replies, and search - #43

Merged
alexeygrigorev merged 1 commit into
mainfrom
hub/intake-daeb37bbb09fbce5239229e1b22242a09b0e63ef3366a128507cc04ba43cd550
Nov 24, 2026
Merged

alexeygrigorev merged 1 commit into
mainfrom
hub/intake-daeb37bbb09fbce5239229e1b22242a09b0e63ef3366a128507cc04ba43cd550

Conversation

@alexeygrigorev

Copy link
Copy Markdown
Member

Fixes silent skips and failures in handle_ban_user and slack.py:

  • Fall back to USER_SLACK_TOKEN in conversations.replies / conversations.history when the bot token gets not_in_channel, channel_not_found, missing_scope, or not_allowed_token_type, and log Slack API errors.
  • Fall back to conversations.history (and support thread_ts) in get_message_content so reacting to a thread reply or a message in an unjoined channel still resolves and passes deletion audit.
  • Fall back to event['item_user'] in handle_ban_user when get_message_content returns None, and search from:<@user_id> via search_user_messages even if users.info has no username.
  • Isolate per-message delete/search exceptions in handle_ban_user so one failure does not abort deleting the spammer's other messages or sending the moderator summary DM.
  • Add targeted unit tests for all failure modes.

@alexeygrigorev
alexeygrigorev merged commit a3f8bde into main Nov 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant