pymaxbot
Python SDK для создания ботов в мессенджере MAX.
Установка
pip install pymaxbot
Быстрый старт
import asyncio
from max_bot import Bot, Dispatcher, run_polling
bot = Bot(token="YOUR_BOT_TOKEN")
dp = Dispatcher(bot)
@dp.message(commands=["start"])
async def start(msg):
await msg.answer("Привет! Я эхо-бот.")
@dp.message()
async def echo(msg):
await msg.answer(f"Вы написали: {msg.text}")
asyncio.run(run_polling(bot, dp))
Возможности
- Отправка текстовых сообщений с поддержкой HTML-форматирования
- Inline-кнопки и обработка callback-нажатий
- Отправка изображений (одно или несколько)
- Отправка файлов/документов
- Удаление сообщений
- Маршрутизация по командам и payload-ам через
Dispatcher - Long polling из коробки
Примеры
Inline-кнопки
@dp.message(commands=["menu"])
async def menu(msg):
await msg.answer(
"Выберите вариант:",
buttons=[
[{"text": "Вариант А", "payload": "option_a"},
{"text": "Вариант Б", "payload": "option_b"}],
[{"text": "Отмена", "payload": "cancel"}],
]
)
@dp.callback(payloads=["option_a", "option_b"])
async def on_option(cb):
await cb.answer()
await cb.reply(f"Вы выбрали: <b>{cb.payload}</b>", format="html")
Отправка изображений
@dp.message(commands=["photo"])
async def photo(msg):
await msg.send_image("image.jpg", text="Подпись к фото")
Отправка файлов
@dp.message(commands=["doc"])
async def doc(msg):
await msg.send_document("report.pdf")
Удаление сообщения
@dp.message(commands=["del"])
async def delete(msg):
sent = await msg.answer("Удалится через 3 секунды...")
await asyncio.sleep(3)
await sent.delete()
Ссылки
Metadata
Release files for pymaxbot 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pymaxbot-0.1.7.tar.gz | 10.0 kB | With provenance | Details for pymaxbot-0.1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymaxbot-0.1.7-py3-none-any.whl | Python 3 | none | any | Details for pymaxbot-0.1.7-py3-none-any.whl |
Total release size: 21.2 kB
Release files / pymaxbot-0.1.7.tar.gz
| Download URL | pymaxbot-0.1.7.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
509f57d4fc8776fd97430025b36eead058f9fcd3ff591b92d5818b91948b08cf
|
|
BLAKE2b-256 checksum How to use checksums |
7fbf4323dd0612b29d53455fd55a278c8dbacab9e2b0eb30299360bb79d3e6a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logRelease files / pymaxbot-0.1.7-py3-none-any.whl
| Download URL | pymaxbot-0.1.7-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e6acd968912d4bd7ec0bd4503edb9d4391b1f423ae3b779769e1d01240f67eb
|
|
BLAKE2b-256 checksum How to use checksums |
17141884e3e7fdaa27a32aac43431c0cb411c5993f36006c91588ef6cc70fa16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logSecurity for pymaxbot 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pymaxbot-0.1.7.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.