Боты
Подключение бота, сообщения, события и полный Bot API.
Здесь собраны команды бота и методы Bot API. Вы сможете найти параметры подключения, сообщений, событий и нужного метода для своего бота.
Подключение бота, сообщения, события и полный Bot API.
Общие опции
Действуют на любую команду.
| Опция | Что делает |
|---|---|
-V, --version | output the version number. |
-v, --verbose | more detail in what is shown: -v ids, -vv everything we know. По умолчанию: 0. |
--json | machine-readable output: one JSON value on stdout, nothing else. |
--jsonl | machine-readable output: one JSON object per line, for streaming and jq. |
--quiet | diagnostics off. |
--trace | one line per request on stderr: ids and timings, never message content. |
--timeout <duration> | give up on the whole command after this — 30s, 2m, 500ms. |
--offline | answer from what was recorded and never connect; fails if nothing was. |
--no-input | не запрашивать ввод и не открывать интерактивный вход; ввод через канал остаётся доступным. |
--max-input-bytes <bytes> | максимальный размер буферизованного ввода в байтах (по умолчанию: 16777216). |
--max-output-bytes <bytes> | максимальный размер машинного вывода в байтах (по умолчанию: 4194304; 0 отключает ограничение). |
--fields <paths> | поля элементов или объекта через запятую: id,text; сохранять пагинацию и идентификаторы операций. |
--dry-run | предварительно показать разобранные аргументы и разрешения перед выполнением действия. |
--yes | go ahead without the question an ask level puts before a write. |
--record | keep this run under max runs — ids and timings, never message content. |
--no-record | do not keep it, whatever the configuration says. |
--serve | start max serve in the background if it is not running (the default). |
--no-serve | do not start it; log in on this command's own connection unless one is running. |
Команды
max bot
a MAX bot, through the official Bot API and a bot token — not your personal account
max bot auth
the bot token this profile uses
max bot auth set
check a bot token with MAX, then keep it — typed at a hidden prompt or piped on stdin
Меняет что-то только на этом компьютере.
max bot auth setmax bot auth show
where this profile's bot token comes from, and which bot it is
max bot auth showmax bot auth remove
forget this profile's bot token
Меняет что-то только на этом компьютере.
max bot auth removemax bot list
every name on this machine that has a bot token; --check asks MAX which bot each is
max bot list [options]| Опция | Что делает |
|---|---|
--check | ask the messenger who each bot is, with its token. |
max bot chats
the chats this bot is in — MAX gives a bot no list of them, so list shows the ones it has seen
max bot chats list
chats this bot has seen on this machine — not a complete list from MAX
max bot chats listmax bot chats show
one chat from MAX, and remember it
max bot chats show <chat>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
max bot chats leave
take the bot out of a chat; only an admin of the chat can bring it back
Меняет что-то в MAX.
max bot chats leave <chat>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата или название чата, который видел этот бот. |
max bot chats action
show what the bot is doing in a chat — typing, sending a photo — for a few seconds
Меняет что-то в MAX.
max bot chats action <chat> <action>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
action | обязательный | what the chat sees. Одно из: typing, photo, video, voice, file. |
max bot chats admins
the admins of a chat the bot is an admin in
max bot chats admins list
the chat's admins and what each may do
max bot chats admins list <chat>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата или название чата, который видел этот бот. |
max bot chats admins add
make a member an admin with these rights
Меняет что-то в MAX.
max bot chats admins add <chat> <person> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата или название чата, который видел этот бот. |
person | обязательный | ID пользователя. |
| Опция | Что делает |
|---|---|
--can <rights> | what they may do, comma-separated: read, members, admins, info, pin, link, edit, delete. |
--title <title> | the title shown beside their name. |
max bot chats admins remove
take an admin's rights back; they stay a member
Меняет что-то в MAX.
max bot chats admins remove <chat> <person>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата или название чата, который видел этот бот. |
person | обязательный | ID пользователя. |
max bot chats members
the people in a chat the bot is an admin in
max bot chats members remove
take a person out of a chat; their messages stay
Меняет что-то в MAX.
max bot chats members remove <chat> <person> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата или название чата, который видел этот бот. |
person | обязательный | ID пользователя. |
| Опция | Что делает |
|---|---|
--block | also keep them from coming back by the chat's link. |
max bot chats members list
members of a chat, a page at a time — --marker takes the marker the last page gave
max bot chats members list <chat> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный |
| Опция | Что делает |
|---|---|
--limit <n> | сколько, до 100. |
--marker <marker> | continue from here. |
max bot chats members add
add people to a chat by user id; the bot must be an admin that may add members
Меняет что-то в MAX.
max bot chats members add <chat> <users>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | |
users | обязательный |
max bot chats rules
a chat's moderation rules for this bot, kept on this machine
max bot chats rules show
the chat's rules; the defaults, marked not saved, if it has none yet
max bot chats rules show <chat>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID группы или название группы, которую видел этот бот. |
max bot chats rules set
change one rule — trusted, blocked, blockedNames, links, invites, forwards, blockedPeople, flood.messages, flood.minutes, flood.action, newAccount.days, newAccount.action, consent.delete, consent.remove
Меняет что-то только на этом компьютере.
max bot chats rules set <chat> <key> <value>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID группы или название группы, которую видел этот бот. |
key | обязательный | правило. |
value | обязательный | its new value. |
max bot chats rules unset
put one rule back to its default
Меняет что-то только на этом компьютере.
max bot chats rules unset <chat> <key>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID группы или название группы, которую видел этот бот. |
key | обязательный | правило. |
max bot chats moderate
judge a group's new messages and joins by its rules, and act as they allow — as the bot
Меняет что-то в MAX.
max bot chats moderate <chat> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID группы или название группы, которую видел этот бот. |
| Опция | Что делает |
|---|---|
--since-time <time> | judge what came after this ISO 8601 time, or 2h / 1d ago; the saved point stays. |
--dry-run | оценить и составить план; ничего не делать. |
--allow-dangerous | yes to every action whose level in the group's rules is ask. |
--no-ban | remove without banning; by default a removed person cannot come back by the link. |
--max-actions <n> | не больше стольких действий за один запуск; если не указано — 10. |
max bot messages
the messages in the chats this bot is in
max bot messages send
send a message as the bot; without [text], the text is read from stdin
Меняет что-то в MAX.
max bot messages send <chat> [text] [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
text | необязательный | сообщение. |
| Опция | Что делает |
|---|---|
--reply-to <message> | answer this message, by its id in the same chat. |
--silent | доставить без уведомления. |
--md | читать текст как Markdown этого мессенджера; поддерживаемый синтаксис — в его руководстве по форматированию. |
--html | the text is HTML: , , , . |
--file <file> | attach a file; the text becomes its caption. |
--photo <file> | attach a .jpg, .png or .webp as a photo; the text becomes its caption. |
--as-file | send the --file as a file to download, a video included. |
--voice <file> | send an Ogg Opus file as a voice message, alone, with no text. |
--allow-any-file | send a file even from a hidden folder, ~/.ssh or this CLI's own folders. |
max bot messages list
the latest messages in a chat; where MAX gives a bot no history, and with --offline, the ones this bot has seen on this machine
max bot messages list <chat> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
| Опция | Что делает |
|---|---|
--limit <n> | how many, the newest. |
max bot messages show
one message by its id in a chat
max bot messages show <chat> <message>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
message | обязательный | ID сообщения. |
max bot messages edit
replace the text of a message the bot sent
Меняет что-то в MAX.
max bot messages edit <chat> <message> <text> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
message | обязательный | ID сообщения. |
text | обязательный | the new text. |
| Опция | Что делает |
|---|---|
--md | читать текст как Markdown этого мессенджера; поддерживаемый синтаксис — в его руководстве по форматированию. |
--html | the text is HTML: , , , . |
max bot messages delete
delete messages in a chat the bot can delete in; it cannot be undone
Меняет что-то в MAX.
max bot messages delete <chat> <messages> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
messages | обязательный | message ids. |
| Опция | Что делает |
|---|---|
--allow-dangerous | delete without asking. |
max bot messages pin
pin a message in a chat; quietly unless --notify
Меняет что-то в MAX.
max bot messages pin <chat> <message> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
message | обязательный | ID сообщения. |
| Опция | Что делает |
|---|---|
--notify | tell the chat's members. |
max bot messages unpin
unpin a message in a chat
Меняет что-то в MAX.
max bot messages unpin <chat> <message>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата, user: для человека или название чата, который видел этот бот. |
message | обязательный | ID сообщения. |
max bot messages between
what two or more people wrote in the chats they have all written in — from the local copy, grouped by chat, oldest first; --limit counts per chat. Common chats are the ones this copy saw each of them write in, not a member list from MAX
max bot messages between <people> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
people | обязательный | two or more people — an id, @username or part of a name each. |
| Опция | Что делает |
|---|---|
--all-bots | также читать копии всех других ботов на этом компьютере, которые разрешает readOtherBots. |
--bots <profiles> | также читать копии этих ботов, через запятую — каждый должен быть разрешён в readOtherBots. |
--limit <n> | how many of the latest messages from each chat. |
max bot search
поиск по тексту в локальной копии этого бота
max bot search messages
search the messages this bot has read, sent or received on this machine — the local copy only, best match first; every word must appear; "a phrase", -word, a OR b, from: chat: after: before: has:; by text, by --from, or both
max bot search messages [query] [options]| Аргумент | Обязательность | Что это |
|---|---|---|
query | необязательный | the words to find. |
| Опция | Что делает |
|---|---|
--all-bots | также читать копии всех других ботов на этом компьютере, которые разрешает readOtherBots. |
--bots <profiles> | также читать копии этих ботов, через запятую — каждый должен быть разрешён в readOtherBots. |
--limit <n> | сколько результатов. |
--newest | сначала новые, а не лучшие совпадения. |
--from <who> | only what this person wrote — an id, @username or part of a name; repeat it for any of several. |
max bot recipients
the chats this bot may write to; with no list, every chat — clear removes the list
max bot recipients list
the chats on the list, or nothing when there is no list
max bot recipients listmax bot recipients add
allow a chat: its id, user:<id>, or the title of a chat this bot has seen
Меняет что-то только на этом компьютере.
max bot recipients add <chat>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный |
max bot recipients remove
take a chat off the list
Меняет что-то только на этом компьютере.
max bot recipients remove <chat>| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный |
max bot recipients clear
remove the list: the bot may write to any chat again
Меняет что-то только на этом компьютере.
max bot recipients clearmax bot sends
what this bot sent, edited and deleted from this machine — ids and outcomes, never text
max bot sends list
max bot sends listmax bot watch
print new messages as they arrive and keep them, until Ctrl-C or --timeout (either ends it normally)
max bot watch [options]| Опция | Что делает |
|---|---|
--events | also edits, deletions, buttons pressed and people coming and going; every line names its event. |
--types <types> | only these update types, comma-separated, in the messenger's words. |
max bot callbacks
answers to the buttons people press under the bot's messages
max bot callbacks answer
answer a pressed button by its callback id: --notification shows the person a one-time note, --text replaces the message the button was on
Меняет что-то в MAX.
max bot callbacks answer <callback> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
callback | обязательный | the callback id bot watch printed. |
| Опция | Что делает |
|---|---|
--text <text> | the message's new text. |
--notification <text> | a note only the person who pressed sees. |
max bot commands
the bot's command menu — what people see after /
max bot commands list
the commands in the menu now
max bot commands listmax bot commands set
replace the whole menu: each command as name=description, e.g. start=Begin
Меняет что-то в MAX.
max bot commands set <commands>| Аргумент | Обязательность | Что это |
|---|---|---|
commands | обязательный | name=description, one per command. |
max bot commands clear
empty the menu
Меняет что-то в MAX.
max bot commands clearmax bot webhooks
where the messenger pushes this bot's updates — while one is set, bot watch gets nothing
max bot webhooks list
the webhooks this bot has
max bot webhooks listmax bot webhooks set
send this bot's updates to an HTTPS address; refused while another is set
Меняет что-то в MAX.
max bot webhooks set <url> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
url | обязательный | the HTTPS address. |
| Опция | Что делает |
|---|---|
--types <types> | only these update types, comma-separated, in the messenger's words. |
--secret-stdin | a secret the messenger sends back with each update — asked for, or read from a pipe. |
--add | keep the webhooks already set and add this one beside them. |
max bot webhooks delete
stop sending updates to this address; with none left, bot watch works again
Меняет что-то в MAX.
max bot webhooks delete <url>| Аргумент | Обязательность | Что это |
|---|---|---|
url | обязательный | the address. |
max bot contacts
people this bot has seen write — from the local copy on this machine, never asking MAX unless told to
max bot contacts show
one person: the chats they wrote in (with their last message there) and the latest messages of their private chat with the bot
max bot contacts show <who> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
who | обязательный | an id, @username or part of a name. |
| Опция | Что делает |
|---|---|
--all-bots | также читать копии всех других ботов на этом компьютере, которые разрешает readOtherBots. |
--bots <profiles> | также читать копии этих ботов, через запятую — каждый должен быть разрешён в readOtherBots. |
--limit <n> | how many messages from the private chat. |
--refresh | read the private chat with them again from the messenger first — one request. |
max bot store
the bot's local copy on this machine
max bot store fetch
fetch a chat's history into the bot's local copy, newest first; run it again to continue
max bot store fetch <chat> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
chat | обязательный | ID чата или название чата, который видел этот бот. |
| Опция | Что делает |
|---|---|
--limit <n> | at most this many messages in this run; 1000 if not given. |
--page-size <n> | how many messages one request asks for; 100 if not given. |
--pause <duration> | pause between pages, to stay under the messenger's limits. По умолчанию: 1s. |
--since-time <time> | stop once it reaches messages older than this: ISO 8601, or 2h / 1d ago. |
--last <n> | stop once the newest n messages are held. |
max bot mcp
serve this bot to an agent over MCP, on stdin and stdout — claude mcp add sales-bot -- max sales bot mcp
max bot mcp [options]| Опция | Что делает |
|---|---|
--confirm-send | больше не используется — операции записи не показывают форму; решение определяют разрешения профиля. |
--allow-dangerous | больше не используется — операции записи не показывают форму; решение определяют разрешения профиля. |
--allow-send | больше не используется — решают права профиля; оставлено, чтобы старая настройка запускалась. |
--allow-delete | больше не используется — решают права профиля. |
--allow-moderate | больше не используется — решают права профиля. |
max bot mcp config
print the mcpServers entry for Claude Desktop, Cursor and others, with full paths; writes nothing
max bot mcp config [options]| Опция | Что делает |
|---|---|
--confirm-send | больше не используется — операции записи не показывают форму; решение определяют разрешения профиля. |
--allow-dangerous | больше не используется — операции записи не показывают форму; решение определяют разрешения профиля. |
--allow-send | больше не используется — решают права профиля; оставлено, чтобы старая настройка запускалась. |
--allow-delete | больше не используется — решают права профиля. |
--allow-moderate | больше не используется — решают права профиля. |
max bot me
the bot this profile's token belongs to: name, id, description, commands
max bot memax bot comments
comments under a channel post — each command takes the post's message id (mid.…) first
max bot comments list
the comments under a post, newest last
max bot comments list <message> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
message | обязательный |
| Опция | Что делает |
|---|---|
--limit <n> | сколько, до 100. |
max bot comments get
one comment under a post
max bot comments get <message> <comment>| Аргумент | Обязательность | Что это |
|---|---|---|
message | обязательный | |
comment | обязательный |
max bot comments send
comment under a post as the bot; - reads stdin
Меняет что-то в MAX.
max bot comments send <message> <text> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
message | обязательный | |
text | обязательный |
| Опция | Что делает |
|---|---|
--format <format> | how the text is marked up. Одно из: markdown, html. |
max bot comments edit
replace the text of a comment the bot wrote; - reads stdin
Меняет что-то в MAX.
max bot comments edit <message> <comment> <text> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
message | обязательный | |
comment | обязательный | |
text | обязательный |
| Опция | Что делает |
|---|---|
--format <format> | how the text is marked up. Одно из: markdown, html. |
max bot comments delete
delete a comment under a post
Меняет что-то в MAX.
max bot comments delete <message> <comment> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
message | обязательный | |
comment | обязательный |
| Опция | Что делает |
|---|---|
--allow-dangerous | не спрашивать подтверждение для bot.messages.delete на уровне ask. |
max bot uploads
files uploaded to MAX, to attach to a message
max bot uploads put
upload a file from disk and print the attachment to put in a message's attachments — messages send --file does both steps at once
Меняет что-то в MAX.
max bot uploads put <file> [options]| Аргумент | Обязательность | Что это |
|---|---|---|
file | обязательный |
| Опция | Что делает |
|---|---|
--type <type> | upload as this kind instead of guessing by extension. Одно из: image, video, audio, file. |
max bot api
every operation of the official Bot API, generated from its schema — docs/dev/bot-api-coverage.md
max bot api [options]| Опция | Что делает |
|---|---|
--store-token <profile> | keep a returned authentication token only in this bot profile's OS keyring; never print it. |
max bot api get-my-info
Get current bot info — read (GET /me)
max bot api get-my-infomax bot api edit-my-commands
Edit current bot commands — write (PATCH /me/commands)
Меняет что-то в MAX.
max bot api edit-my-commands [options]| Опция | Что делает |
|---|---|
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api get-chat
Get chat — read (GET /chats/{chatId})
max bot api get-chat [options]| Опция | Что делает |
|---|---|
--chat-id <value> | Requested chat or channel identifier. |
max bot api edit-chat
Edit chat or channel info — write (PATCH /chats/{chatId})
Меняет что-то в MAX.
max bot api edit-chat [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api send-action
Send action — write (POST /chats/{chatId}/actions)
Меняет что-то в MAX.
max bot api send-action [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api get-pinned-message
Get pinned message — read (GET /chats/{chatId}/pin)
max bot api get-pinned-message [options]| Опция | Что делает |
|---|---|
--chat-id <value> | Chat identifier to get its pinned message. |
max bot api pin-message
Pin message — write (PUT /chats/{chatId}/pin)
Меняет что-то в MAX.
max bot api pin-message [options]| Опция | Что делает |
|---|---|
--chat-id <value> | Chat identifier where message should be pinned. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api unpin-message
Unpin message — write (DELETE /chats/{chatId}/pin)
Меняет что-то в MAX.
max bot api unpin-message [options]| Опция | Что делает |
|---|---|
--chat-id <value> | Chat identifier to remove pinned message. |
max bot api get-membership
Get chat or channel membership — read (GET /chats/{chatId}/members/me)
max bot api get-membership [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
max bot api leave-chat
Leave chat — destructive (DELETE /chats/{chatId}/members/me)
Меняет что-то в MAX.
max bot api leave-chat [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
max bot api get-admins
Get chat or channel admins — read (GET /chats/{chatId}/members/admins)
max bot api get-admins [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
max bot api post-admins
Set chat or channel admins — write (POST /chats/{chatId}/members/admins)
Меняет что-то в MAX.
max bot api post-admins [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api delete-admins
Revoke admin rights — write (DELETE /chats/{chatId}/members/admins/{userId})
Меняет что-то в MAX.
max bot api delete-admins [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
--user-id <value> | User identifier. |
max bot api get-members
Get members — read (GET /chats/{chatId}/members)
max bot api get-members [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
--user-ids <value> | Comma-separated list of users identifiers to get their membership. When this parameter is passed, both count and marker are ignored. |
--marker <value> | Marker. |
--count <value> | Count. |
max bot api add-members
Add members — write (POST /chats/{chatId}/members)
Меняет что-то в MAX.
max bot api add-members [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api remove-member
Remove member — write (DELETE /chats/{chatId}/members)
Меняет что-то в MAX.
max bot api remove-member [options]| Опция | Что делает |
|---|---|
--chat-id <value> | ID чата или канала. |
--user-id <value> | User id to remove from chat or channel. |
--block <value> | Set to true if user should be blocked in chat. |
max bot api get-subscriptions
Get subscriptions — read (GET /subscriptions)
max bot api get-subscriptionsmax bot api subscribe
Subscribe — write (POST /subscriptions)
Меняет что-то в MAX.
max bot api subscribe [options]| Опция | Что делает |
|---|---|
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api unsubscribe
Unsubscribe — write (DELETE /subscriptions)
Меняет что-то в MAX.
max bot api unsubscribe [options]| Опция | Что делает |
|---|---|
--url <value> | URL to remove from WebHook subscriptions. |
max bot api get-upload-url
Get upload URL — write (POST /uploads)
Меняет что-то в MAX.
max bot api get-upload-url [options]| Опция | Что делает |
|---|---|
--type <value> | Uploaded file type: image, audio, video, file. |
max bot api get-messages
Get messages — read (GET /messages)
max bot api get-messages [options]| Опция | Что делает |
|---|---|
--chat-id <value> | Chat or channel identifier to get messages in chat or channel. |
--message-ids <value> | Comma-separated list of message ids to get. |
--from <value> | Start time for requested messages - use after instead. |
--to <value> | End time for requested messages - use before instead. |
--before <value> | Messages before timestamp. |
--after <value> | Messages after timestamp. |
--count <value> | Maximum amount of messages in response. |
max bot api send-message
Send message — write (POST /messages)
Меняет что-то в MAX.
max bot api send-message [options]| Опция | Что делает |
|---|---|
--user-id <value> | Fill this parameter if you want to send message to user. |
--chat-id <value> | Fill this if you send message to chat or channel. |
--disable-link-preview <value> | If false, server will not generate media preview for links in text. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api edit-message
Edit message — write (PUT /messages)
Меняет что-то в MAX.
max bot api edit-message [options]| Опция | Что делает |
|---|---|
--message-id <value> | Editing message identifier. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api delete-message
Delete message — destructive (DELETE /messages)
Меняет что-то в MAX.
max bot api delete-message [options]| Опция | Что делает |
|---|---|
--message-id <value> | Deleting message identifier. |
--allow-dangerous | не спрашивать подтверждение для bot.messages.delete на уровне ask. |
max bot api get-message-by-id
Get message — read (GET /messages/{messageId})
max bot api get-message-by-id [options]| Опция | Что делает |
|---|---|
--message-id <value> | Message identifier (mid) to get single message in chat or channel. |
max bot api get-comments
Get comments — read (GET /messages/{messageId}/comments)
max bot api get-comments [options]| Опция | Что делает |
|---|---|
--message-id <value> | ID (mid) комментируемого сообщения. |
--comment-ids <value> | Comma-separated list of comment ids to get. |
--before <value> | Comments before timestamp. |
--after <value> | Comments after timestamp. |
--count <value> | Maximum amount of comments in response. |
max bot api send-comment
Send comment — write (POST /messages/{messageId}/comments)
Меняет что-то в MAX.
max bot api send-comment [options]| Опция | Что делает |
|---|---|
--message-id <value> | ID (mid) комментируемого сообщения. |
--disable-link-preview <value> | If false, server will not generate media preview for links in text. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api edit-comment
Edit comment — write (PUT /messages/{messageId}/comments)
Меняет что-то в MAX.
max bot api edit-comment [options]| Опция | Что делает |
|---|---|
--message-id <value> | ID (mid) комментируемого сообщения. |
--comment-id <value> | Editing comment identifier. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api delete-comment
Delete comment — destructive (DELETE /messages/{messageId}/comments)
Меняет что-то в MAX.
max bot api delete-comment [options]| Опция | Что делает |
|---|---|
--message-id <value> | ID (mid) комментируемого сообщения. |
--comment-id <value> | Deleting comment identifier. |
--allow-dangerous | не спрашивать подтверждение для bot.messages.delete на уровне ask. |
max bot api get-comment-by-id
Get comment — read (GET /messages/{messageId}/comments/{commentId})
max bot api get-comment-by-id [options]| Опция | Что делает |
|---|---|
--message-id <value> | ID (mid) комментируемого сообщения. |
--comment-id <value> | Comment identifier (mid) to get single comment in channel. |
max bot api get-video-attachment-details
Get video details — read (GET /videos/{videoToken})
max bot api get-video-attachment-details [options]| Опция | Что делает |
|---|---|
--video-token <value> | Video attachment token. |
max bot api answer-on-callback
Answer on callback — write (POST /answers)
Меняет что-то в MAX.
max bot api answer-on-callback [options]| Опция | Что делает |
|---|---|
--callback-id <value> | Identifies a button clicked by user. Bot receives this identifier after user pressed button as part of MessageCallbackUpdate. |
--disable-link-preview <value> | If true, server will not generate media preview for links in updated message text. |
--body <json> | тело запроса в JSON; - читает его из stdin. |
--body-file <path> | тело запроса из файла JSON; - означает stdin. |
max bot api get-updates
Get updates — write (GET /updates)
Меняет что-то в MAX.
max bot api get-updates [options]| Опция | Что делает |
|---|---|
--limit <value> | Maximum number of updates to be retrieved. |
--poll-timeout <value> | Timeout in seconds for long polling. |
--marker <value> | Pass null to get updates you didn't get yet. |
--types <value> | Comma separated list of update types your bot want to receive. |
Коды возврата
Скрипт ветвится по коду, а не по тексту: текст меняется, код — нет.
| Код | Когда |
|---|---|
0 | получилось |
2 | validation_error |
3 | configuration_error |
4 | authentication_error |
5 | permission_error |
6 | not_found |
7 | confirmation_required |
8 | rate_limited |
9 | timeout |
10 | network_error |
11 | provider_error |
12 | provider_unavailable |
13 | invalid_response |
14 | outcome_unknown |
130 | cancelled |
1 | всё остальное |
0 и только 0 означает, что операция выполнена. 14 — outcome_unknown — означает, что
сообщение могло уйти: не отправлено и не провалено, и повторять его можно только с тем же
--send-id.