generated from exteraGramPlugins/pluginBase
Lists the panel account's client commands as Telegram slash commands (hourly refresh, cached on the device), shows their parameters while typing, runs complete commands on the panel instead of sending them and shows the answer as an "Only visible to you" message (latest 20 kept in memory). Holding send offers Run / Send as message / Send response in chat (red ! badge); an answer's menu starts with Send in chat. Other plugins register their own commands through the client_commands library module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70 lines
4.0 KiB
Markdown
70 lines
4.0 KiB
Markdown
<p align="center">
|
|
<img src="images/icon.svg" width="128" height="128" alt="Client Commands icon">
|
|
</p>
|
|
|
|
<h1 align="center">Client Commands</h1>
|
|
|
|
**TL;DR:** an [exteraGram](https://exteragram.app) plugin that turns your
|
|
[telegram-panel](../../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
|
|
add `name:`.
|
|
- **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](docs/library.md).
|
|
|
|
## Setup
|
|
|
|
1. In the panel, open Settings → API Tokens and create a **Client commands** token for each
|
|
of your accounts that uses exteraGram. Message logger tokens don't work here, and these
|
|
tokens don't work for the message logger.
|
|
2. In the plugin settings, enter the panel URL and the tokens, separated by spaces.
|
|
3. Tap *Test connection*. *Available commands* lists what the current account has.
|
|
|
|
Your panel user needs the `client:commands:use` permission.
|
|
|
|
## Documentation
|
|
|
|
- [How Client Commands works](docs/how-it-works.md): the panel API, parsing, the hooks
|
|
- [The library](docs/library.md): adding commands from another plugin
|
|
- [Development](docs/development.md): getting started, repo layout, building and verifying, icon export
|
|
- [How exteraGram plugins work](docs/how-plugins-work.md): the plugin format and lifecycle
|
|
- [Device setup and ADB automation](docs/device-and-adb.md): deploy, watch, logs, debugger
|
|
- [Versioning and releases](docs/versioning-and-releases.md): git hooks, auto-bump, CI publishing
|
|
- [SDK notes](docs/sdk-notes.md): condensed exteraGram SDK API surface
|