generated from exteraGramPlugins/pluginBase
Publish plugin / publish (push) Successful in 5s
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>
72 lines
4.1 KiB
Markdown
72 lines
4.1 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. 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.
|
|
2. In the plugin settings, enter the panel URL and the token.
|
|
3. 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](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
|