One token runs the commands of every account of its owner on the panel: /me lists them, the plugin asks for the commands of each one signed in on the device, and every request names its account by Telegram user id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4.1 KiB
Client Commands
TL;DR: an exteraGram plugin that turns your telegram-panel account's commands into Telegram slash commands with Discord-style parameters. They run on the panel instead of being sent, and only you see the answer. Other plugins can add their own commands through it.
Description
The panel runs your Telegram account and gives it commands (such as /getid). Sent as an
ordinary message, the panel picks a command up from the account's own update and edits the
message into its answer. That still works without this plugin.
With the plugin, typing / lists the account's commands the way Telegram lists a bot's
commands. Sending one asks the panel to run it, and the answer appears in the chat only for
you, as one of Telegram's "Only visible to you" messages. Nothing goes into the chat unless
you choose so.
Features
- Telegram's command list. Typing
/shows the account's commands above the input, with the account's avatar, each command's parameters and its summary, before any bot commands of the chat. Tapping or holding a command puts it into the field; only the send button runs it. - Discord-style parameters. After
/command, the list shows the command's parameters: their type, whether they are required, and whether the command needs a reply. The parameter at the cursor is blue, given ones are green with their value, and missing required ones are red. Values go in order or by name (days:7), and quotes group words. Tap a parameter to addname:. - Runs instead of sending. A complete command goes to the panel when you press send. An incomplete one stays in the field and a bulletin says what is missing. A command is only ever sent as text through Send as message.
- Private answers. The answer shows as your own message, marked "Only visible to you", with the command above it. The latest 20 answers stay in memory and come back when you reopen their chat, until the app restarts; an answer to a command run while its chat was closed shows there too. Deleting one removes it for good. Tap it and choose Send in chat, the first item of its menu, to post the answer into the chat as you.
- Hold send for options. Holding send on a command offers Run, Send as message (the panel then handles it from the update, as without the plugin) and a Send response in chat check. While that check is on and the command can run, the send button shows a red !: the panel will post the answer into the chat as you.
- Kept fresh. The panel's command list of every signed-in account is fetched hourly and cached on the device, so commands show at once, even offline.
- A library for other plugins. Plugins can register their own commands, with parameters, that run on the device. See docs/library.md.
Setup
- In the panel, open Settings → API Tokens and create a Client commands token. One token covers all your accounts on the panel: each request names the account it comes from. Message logger tokens don't work here, and these tokens don't work for the message logger.
- In the plugin settings, enter the panel URL and the token.
- Tap Test connection: it lists your panel accounts signed in on this device. Available commands lists what the current account has.
Your panel user needs the client:commands:use permission.
Documentation
- How Client Commands works: the panel API, parsing, the hooks
- The library: adding commands from another plugin
- Development: getting started, repo layout, building and verifying, icon export
- How exteraGram plugins work: the plugin format and lifecycle
- Device setup and ADB automation: deploy, watch, logs, debugger
- Versioning and releases: git hooks, auto-bump, CI publishing
- SDK notes: condensed exteraGram SDK API surface