Mass actions

Cross-group moderation commands.

Mass actions ban or mute a Telegram user across active groups in the same account.

Available Actions

Current action types:

  • Ban: /banall
  • Mute: /muteall

Where to Run Commands

Run mass-action commands inside a connected Telegram group.

The group must belong to the account where the action should run.

Required Role

The sender must have an account role that can run moderation operations:

  • owner
  • admin
  • manager

Required Bot Permission

In each target group, the bot needs:

  • Admin status.
  • Restrict members permission.

Groups missing the permission are skipped with skipped_no_permission.

Target Selection

The current reliable workflow is to reply to a user's message.

Example:

Reply to the target user's message with:
/banall

or:

Reply to the target user's message with:
/muteall

The group help text mentions /banall <user or reply> and /muteall <user or reply>, but the implemented failure message asks users to reply to a user's message. Use reply mode for operational reliability.

Safety Checks

The bot rejects mass actions when:

  • The source group is not connected.
  • The sender is not known to GramGroupsBot.
  • The sender has no account access.
  • The sender role is not allowed.
  • The command is not a reply to a detectable user.
  • The target user cannot be detected.
  • The target is the sender.
  • The target is a bot.

Execution Scope

A mass action runs across all groups in the account.

For each group:

  • Active groups with required permissions are processed.
  • Inactive groups are skipped with skipped_not_active.
  • Groups where the bot cannot restrict members are skipped with skipped_no_permission.
  • Telegram API failures are stored as failed results.

Mute Duration

Current mute action restricts the target for 24 hours.

Execution Model

Mass actions are queued and executed asynchronously with bounded concurrency.

Default max concurrency is 3 groups at a time.

The bot replies in the source group:

Mass action queued. I will apply it to eligible groups.

Dashboard Review

Dashboard path:

/mass-actions

The Mass Actions page shows recent actions and per-group results.

Action statuses:

  • queued
  • running
  • completed
  • completed_with_errors
  • failed

Per-group result statuses:

  • success
  • skipped_no_permission
  • skipped_not_active
  • failed

Example Workflow

  1. A spammer posts in one connected group.
  2. An operator replies to that spammer's message with /banall.
  3. The bot queues the action.
  4. Eligible active groups receive a ban request for that Telegram user ID.
  5. The operator checks /mass-actions for skipped or failed groups.
  6. If many groups were skipped for permissions, fix bot permissions and rerun if needed.