Files
cg_api_secure-webshare/docs/COMMANDS.md

6.1 KiB

Bot Commands

This document lists all commands and callback actions implemented in crates/cgcx-bot/src/main.rs.


Admin Commands (Groups & Channels)

All admin commands require the caller to be an administrator or owner of the chat. They work in groups, supergroups, and channels where the bot is present.

Command Args Description
/reload none Reload moderation lists from disk.
/blacklist_uid [ID] Blacklist a user by Telegram ID globally and set their role to banned. Restricted to configured admin groups; the caller must be an admin there. Shows usage info (Usage: /blacklist_uid <user_id>) if the ID argument is missing.
/whitelist_uid [ID] Remove a user from the global blacklist and restore their role to user. Restricted to configured admin groups; the caller must be an admin there. Shows usage info (Usage: /whitelist_uid <user_id>) if the ID argument is missing.
/help none Show the admin help message listing all admin commands. Properly HTML-escaped. Argument placeholders in the help text use [arg] format to avoid Telegram HTML parse errors with angle brackets.
/get_id none Get the current chat ID. Works in groups, supergroups, and channels.
/get_id [@username] Search administrators in this chat by username. Results are HTML-escaped.
/get_id [displayname] Search members in this chat by display name. Results are HTML-escaped.
/create_submit_forward <dest_chat_id> <review_group_id> [forward_message] Create a submission forward link. Bot must be admin in both destination and review groups.
/show_c_forward [page] List active forward links for this chat with pagination.
/add_blacklist <user_id> Blacklist a user in all active forwards for this source chat.
/rm_blacklist <user_id> Remove a user from the blacklist in all active forwards for this source chat.
/sban @user <dur> <unit> [reason] Ban a user for a specified duration. Propagates across all known chats when global_ban = true.
/smute @user <dur> <unit> [reason] Mute a user for a specified duration. Propagates across all known chats when global_ban = true.
/mute @user [reason] Mute a user indefinitely. Propagates across all known chats when global_ban = true.
/pban @user [reason] Permanently ban a user. Propagates across all known chats when global_ban = true.
/kick @user [reason] Kick a user from the group. Propagates across all known chats when global_ban = true.
/rmute @user Revoke an active mute and restore the user's chat permissions.
/rban @user Revoke an active ban and unban the user.

User Commands (DM)

Command Args Description
/start none Start the bot. Displays terms if not accepted, otherwise shows the main menu.
/start submitfwdid<code> Deep-link entry into Submission Mode for a forward.
/cancel none Cancel the current operation and return to the main menu.

Callback Actions

Callbacks use the format v1:<namespace>:<action>[:<id>].

Terms

Callback Description
v1:terms:accept Accept the terms of service.
v1:terms:reject Reject the terms of service.

Main Menu

Callback Description
v1:menu:upload_media Enter media upload staging.
v1:menu:upload_doc Enter document upload staging.
v1:menu:upload_text Enter text upload staging.
v1:menu:prev_uploads View previous uploads.
v1:menu:report Enter content reporting flow.
v1:menu:main Return to main menu.

Staging

Callback Description
v1:stage:confirm Confirm staged items and proceed to upload options.
v1:stage:cancel Cancel the upload and return to main menu.

Upload Options

Callback Description
v1:opt:toggle_destroy Cycle auto-destroy max views (Off → 1 → 3 → 5 → 10 → 50 → Off).
v1:opt:toggle_download Toggle the "allow download" flag.
v1:opt:set_password Prompt user to send a password (or /skip).
v1:opt:confirm_final Confirm options and finalize the upload.
v1:opt:back Go back to upload staging.

Previous Uploads

Callback Description
v1:prev:page:{page} Navigate to a specific page of previous uploads.

Submission Mode

Callback Description
v1:submit:continue Continue into submission upload flow.
v1:submit:exit Exit submission mode and return to main menu.

Admin / Moderation

Callback Description
v1:admin:delcontent:{cxid} Delete a content item by its CXID.
v1:admin:delblk:{report_id} Delete reported content and blacklist the uploader.
v1:admin:del:{report_id} Delete reported content only.
v1:admin:blk:{report_id} Blacklist the uploader of reported content only.
v1:admin:ign:{report_id} Ignore/dismiss the report.

Forward Submissions

Callback Description
v1:fwd:approve:{submission_id} Approve a forward submission and post it to the destination chat.
v1:fwd:ignore:{submission_id} Reject a forward submission.
v1:fwd:blk:{submission_id} Blacklist the submitting user from the forward.
v1:fwd:ban:{submission_id} Ban the submitter in the destination chat and review group.
v1:fwd:banblk:{submission_id} Ban + blacklist the submitter in one action.
v1:fwd:revoke:{forward_id} Revoke a forward link.
v1:fwd:page:{page} Navigate forward link list pages.

Review Message Buttons

When a submission is sent to the review group, the inline keyboard includes:

  • Row 1: [ Approve ], [ Ignore ]
  • Row 2: [ Blackl. ], [ Ban ], [ Ban/BL u. ]

These correspond to the callbacks above and allow moderators to take action directly from the review message.