group_moderate
Run ONE moderation action on a group: a Telegram bot group or a Discord SERVER the connected account administers, or a WhatsApp group the connected number is a member of.
Discord actions (channel='discord'; chat_id = the server id, a channel id, a channel's thread ref or our thread id; params.account_id names the account when the workspace has several and chat_id does not; only an account connected in THIS workspace, never one shared in):
community: switch Community mode on (rules screening and announcement channels become possible). params: rules_channel (default #rules), updates_channel (where Discord posts its notices to the team; default a hidden #moderator-only, made when missing), announcement_channel (the one turned into an announcement channel, default #announcements; false for none); channels by id, ref or #name. Discord's conditions change server defaults (verification level at least low, media filter for everyone, notifications to mentions only): the answer lists them in settings_changed; tell the person
icon: params: file_id of a PNG/JPEG/GIF/WebP in this workspace
set_title: params: title. set_description: params: description (community servers only)
role: params: name, permissions (names such as view_channel, send_messages, manage_messages, kick_members, moderate_members, administrator, or Discord's bitfield as a number), color (#rrggbb), hoist, mentionable. Not idempotent: a retry makes a second role
slowmode: params: channel (id, ref or #name) and seconds (0 to 21600; 0 turns it off), both required
delete: the OWNER deletes the server. Irreversible: params.confirm_name must be the server's exact name (ask the person); with two-factor on, Discord wants params.mfa_code, the current authenticator code the person reads out (redacted from every log and trace) Every Discord action needs the caller to be a workspace owner or admin. Discord refusals are worded: no_permission (not an admin), mfa_required, not_community, bad_request (a value Discord rejected).
WhatsApp actions (channel='whatsapp'; chat_id = the group JID (...@g.us), its whatsapp: ref or our thread id; only the workspace's own numbers, not one shared in; the number that is in the group is used):
set_title: params: title (at most 100 characters). Any member may rename unless the group's admins locked its info; WhatsApp's refusal is passed through. Needs edit rights in the workspace. When two of the workspace's numbers are in the group, params.account_id is required. The inbox thread takes the new name.
Telegram actions:
invite_link: mint a fresh invite link; older links stay valid. Optional params: name, member_limit, expire_date, creates_join_request
revoke_invite_link: params: invite_link
admins: list administrators (user_id, username, name, status)
member_count: how many members the group has
member_status: one member's status. params: user_id
promote / demote: params: user_id, optional rights {can_*: bool}
ban / unban: params: user_id, optional revoke_messages
mute / unmute: params: user_id, optional until_date (unix ts)
pin / unpin: params: message_id (omit on unpin for the latest), optional silent
set_title: params: title
set_description: params: description
⚠️ A Telegram BOT cannot add a member or create a group — the Bot API has no method for either. To bring someone in, mint an invite_link and send it to them.
Telegram rules that surprise callers (all verified against a live group):
A bot may only promote/demote admins IT promoted. Check
can_be_editedin member_status first: false means demote will answer 'not enough rights', and that is Telegram, not a failure on our side.promote additionally needs the bot to hold can_promote_members in the group; plain admin rights are not enough.
After unmute the status stays 'restricted' while every can_send_* is true. That is Telegram labelling anyone who carries an explicit permission set — it does NOT mean still muted. Read the permissions, not the status.
unban lifts the ban but does not bring the person back: the status becomes 'left' and they must rejoin.
Returns: success plus the action's own keys (invite_link, admins, member_count, status) and result, Telegram's own payload.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Which action to run (see the tool description for the list) | |
| params | No | Action-specific arguments, e.g. {'user_id': 123} for promote/ban, {'message_id': '456'} for pin, {'title': '...'} for set_title | |
| channel | Yes | Channel the group lives on, e.g. 'telegram_bot', 'discord' or 'whatsapp' | |
| chat_id | Yes | Group to act on: the platform chat id (e.g. -1004487018858), a channel_ref, or our numeric DB thread id | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |