Releases: mammothcoding/maxoxide
v2.0.0
[2.0.0] - 2026-04-27
EN
Release summary
This release aligns maxoxide with the current public MAX REST API, adds convenience helpers for media sending, makes update parsing more forward-compatible, and expands the dispatcher into a more practical routing layer.
Breaking changes
User::namewas replaced with MAX-style profile fields:first_namelast_nameusernamedescriptionavatar_urlfull_avatar_urlcommands
- Use
User::display_name()when the old code needs a single printable name. Update::timestamp()now returnsOption<i64>because unknown future updates may omit a timestamp.- Use
Update::timestamp_or_default()when the previous0fallback behavior is desired. MessageFormat::Plainwas removed. Plain text is represented by leavingNewMessageBody::formatasNone.Button::open_app(...)now follows the official Go SDK wire model withweb_app, optionalpayload, and optionalcontact_idfields instead of an opaque JSON payload.NewAttachment::Imagenow carriesImageAttachmentPayloadinstead ofUploadedToken, so it can serialize the official MAXphotostoken map returned by image uploads.NewAttachment::image(token)remains available for the simple token form.- Public enums that mirror MAX wire values are now
#[non_exhaustive]; downstream exhaustive matches need a wildcard arm. src/types/mod.rswas replaced bysrc/types.rs. The public path remainsmaxoxide::types.
Added
- Added typed fallback support for unknown
Updateand unknown attachments, preserving raw JSON for later inspection. - Added attachment deserialization for both wrapped
payloadobjects and flat attachment objects, soButton::RequestGeoLocationupdates deserialize asAttachment::Locationwithlatitudeandlongitude. The client can render the same shared position as a Yandex Maps card. - Added typed string enums with unknown-value preservation:
ChatTypeChatStatusMessageFormatButtonIntentLinkTypeChatAdminPermissionSenderAction
- Added more complete MAX models for users, chats, members, admins, video metadata, photo payloads, and partial success results.
- Added
Button::OpenAppusing the official Go SDK fieldsweb_app,payload, andcontact_id. - Added
Button::Clipboard, which is present in the official Go SDK and can be validated through the live harness. - Added builders for
NewMessageBody,NewAttachment, andUploadedToken. - Added
SendMessageOptionswithdisable_link_preview. - Added message, video, member, and admin endpoints:
get_messages_by_idsget_videoget_members_by_idsadd_adminsremove_admin
- Added typed sender action methods:
send_sender_actionsend_typing_onsend_sending_imagesend_sending_videosend_sending_audiosend_sending_filemark_seen
- Added upload-and-send helpers for both chat and user recipients:
send_image_to_chat/send_image_to_usersend_video_to_chat/send_video_to_usersend_audio_to_chat/send_audio_to_usersend_file_to_chat/send_file_to_user- byte-based variants for the same media types
- Added
Dispatcher::on_update, composableFiltervalues, regex text filters, media/file attachment filters,on_start,task,on_raw_update, and raw polling viaget_updates_raw. - Added
examples/media_bot.rsandexamples/dispatcher_filters_bot.rs.
Changed
get_upload_urlnow serializes upload types using the documented lowercase wire values.- Long polling now receives raw update JSON first, then dispatches through raw and typed handlers.
- Webhook handling now dispatches raw JSON through the same dispatcher path as long polling.
- Upload helpers now accept attachment tokens from either the upload endpoint response or multipart upload response, preserve the MAX
photostoken map for image send helpers, and retry briefly while MAX reports an uploaded attachment as not processed yet. - The live harness now treats empty contact phone payloads as a MAX platform gap, recognizes structured request-location attachments, logs non-matching updates during manual waits, and checks the bot's granular
add_adminspermission before probing admin-right changes. - README examples now use builders and the new media helpers.
- The crate version was bumped to
2.0.0.
Verification
cargo fmt --allcargo check --all-targets --all-featurescargo testcargo test --features webhookcargo clippy --all-targets --all-features -- -D warnings
RU
Кратко о релизе
Этот релиз синхронизирует maxoxide с текущим публичным REST API MAX, добавляет helpers для отправки медиа, делает разбор обновлений устойчивее к будущим типам MAX и расширяет Dispatcher до более практичного роутинга.
Ломающие изменения
User::nameзаменён на поля профиля в стиле MAX:first_namelast_nameusernamedescriptionavatar_urlfull_avatar_urlcommands
- Если старому коду нужна одна строка для отображения имени, используйте
User::display_name(). Update::timestamp()теперь возвращаетOption<i64>, потому что неизвестные будущие update могут не содержать timestamp.- Для старого поведения с fallback в
0используйтеUpdate::timestamp_or_default(). MessageFormat::Plainудалён. Обычный текст задаётся отсутствиемformatвNewMessageBody.Button::open_app(...)теперь следует wire-модели официального Go SDK с полямиweb_app, optionalpayloadи optionalcontact_id, а не opaque JSON payload.NewAttachment::Imageтеперь хранитImageAttachmentPayloadвместоUploadedToken, чтобы сериализовать официальный MAXphotostoken map, который возвращают image uploads.NewAttachment::image(token)остаётся доступным для простой token-формы.- Публичные enum, отражающие wire-значения MAX, теперь
#[non_exhaustive]; во внешнем коде exhaustivematchдолжны иметь wildcard arm. src/types/mod.rsзаменён наsrc/types.rs. Публичный путь остаётся прежним:maxoxide::types.
Добавлено
- Добавлен fallback для неизвестных
Updateи неизвестных вложений с сохранением raw JSON. - Добавлен разбор вложений как в wrapped
payloadформе, так и в плоской форме attachment object, поэтому updates отButton::RequestGeoLocationдесериализуются какAttachment::Locationсlatitudeиlongitude. В клиенте та же отправленная позиция может отображаться как карточка Яндекс Карт. - Добавлены типизированные строковые enum с сохранением неизвестных значений:
ChatTypeChatStatusMessageFormatButtonIntentLinkTypeChatAdminPermissionSenderAction
- Расширены модели MAX для пользователей, чатов, участников, администраторов, video metadata, photo payloads и частично успешных результатов.
- Добавлен
Button::OpenAppс полями официального Go SDK:web_app,payload,contact_id. - Добавлен
Button::Clipboard, который есть в официальном Go SDK и проверяется через live harness. - Добавлены builders для
NewMessageBody,NewAttachmentиUploadedToken. - Добавлен
SendMessageOptionsсdisable_link_preview. - Добавлены методы для сообщений, видео, участников и администраторов:
get_messages_by_idsget_videoget_members_by_idsadd_adminsremove_admin
- Добавлены типизированные действия отправителя:
send_sender_actionsend_typing_onsend_sending_imagesend_sending_videosend_sending_audiosend_sending_filemark_seen
- Добавлены helpers загрузки и отправки для chat/user адресатов:
send_image_to_chat/send_image_to_usersend_video_to_chat/send_video_to_usersend_audio_to_chat/send_audio_to_usersend_file_to_chat/send_file_to_user- byte-based варианты для тех же типов медиа
- Добавлены
Dispatcher::on_update, составныеFilter, regex-фильтры текста, фильтры media/file вложений,on_start,task,on_raw_updateи raw polling черезget_updates_raw. - Добавлены
examples/media_bot.rsиexamples/dispatcher_filters_bot.rs.
Изменено
get_upload_urlтеперь сериализует типы загрузки документированными lowercase wire-значениями.- Long polling сначала получает raw JSON update, затем dispatch проходит через raw и typed handlers.
- Webhook теперь dispatchит raw JSON тем же путём, что и long polling.
- Upload helpers принимают attachment token как из ответа upload endpoint, так и из multipart upload response, сохраняют MAX
photostoken map для image send helpers и коротко ретраят отправку, пока MAX сообщает, что вложение ещё не обработано. - Live harness теперь помечает пустой телефон в contact payload как platform gap MAX, распознаёт структурированные request-location attachments, логирует неподходящие updates во время ручного ожидания и проверяет granular-право бота
add_adminsперед проверкой изменения admin-прав. - Примеры README переведены на builders и новые media helpers.
- Версия крейта повышена до
2.0.0.
Проверка
cargo fmt --allcargo check --all-targets --all-featurescargo testcargo test --features webhookcargo clippy --all-targets --all-features -- -D warnings
v1.0.0
[1.0.0] - 2026-03-25
EN
Release summary
This release promotes maxoxide from 0.1.0 to 1.0.0, adds a real interactive live API test harness for MAX, fixes several real-API mismatches, and makes message delivery APIs explicit about whether they target a chat_id or a user_id.
Breaking changes
- Removed the old shorthand methods:
send_textsend_markdownsend_message
- Added explicit recipient-specific methods:
send_text_to_chat(chat_id, text)send_text_to_user(user_id, text)send_markdown_to_chat(chat_id, text)send_markdown_to_user(user_id, text)send_message_to_chat(chat_id, body)send_message_to_user(user_id, body)
- Migration for apps still on
0.1.0:- Replace
send_text(chat_id, text)withsend_text_to_chat(chat_id, text) - Replace
send_markdown(chat_id, text)withsend_markdown_to_chat(chat_id, text) - Replace
send_message(chat_id, body)withsend_message_to_chat(chat_id, body) - If you only know a global MAX
user_id, use the new*_to_user(...)methods
- Replace
Added
- Added
examples/live_api_test.rs, an interactive real-API harness with:- English and Russian language selection
- runtime input for token, bot URL, webhook settings, file path, delays, and timeouts
- manual tester-driven steps in the MAX client
- optional group-chat phase
PASS / FAIL / SKIPsummary- non-blocking manual waits with
continue / skip / fail
- Added a
/get_my_idlive-test flow and senderuser_idlogging - Added live coverage for both
*_to_chatand*_to_usermethods, including attachment sending viauser_id - Added tests that explicitly verify the difference between
chat_idanduser_id
Changed
- Clarified throughout the docs that:
user_idis the global MAX user identifierchat_idis the identifier of a concrete dialog, group, or channel
- Updated README, README.ru, examples, and crate-level docs to use only the explicit
*_to_chat/*_to_userAPIs - Reworked API tables so chat-targeted and user-targeted methods are listed side by side
- Bumped the crate version to
1.0.0
Fixed
- Fixed
answer_callbackto sendcallback_idas a query parameter, matching the real MAX API - Fixed
edit_messageto returnSimpleResultinstead of incorrectly deserializing aMessage - Switched HTTP response parsing to
bytes + String::from_utf8_lossyto avoid crashes on invalid UTF-8 - Added lossy attachment deserialization so malformed or unknown attachments do not break entire update/message parsing
- Updated action handling and live testing to use the real MAX action value
typing_on
MAX platform gaps documented by live testing
request_contactis documented by MAX, but live tests received a contact attachment with emptycontact_idand emptyvcf_phonerequest_geo_locationis documented by MAX, and the mobile client shows a sent location card, but the bot did not receive a matching update in live polling teststyping_onreturns a successful API response, but the client-side typing indicator was not reliably visible in live testingset_my_commandsremains experimental: livePOST /me/commandsrequests returned404, and the public MAX REST docs do not currently expose a documented write endpoint for command menu updates
Verification
cargo fmt --allcargo check --example live_api_testcargo test- The live API test was successfully completed against a real MAX bot during this release cycle
RU
Кратко о релизе
Этот релиз переводит maxoxide с ветки 0.1.0 на 1.0.0, добавляет полноценный интерактивный live-тест на реальном API MAX, исправляет несколько несовпадений с реальным поведением платформы и делает API отправки сообщений явным по типу получателя: chat_id или user_id.
Ломающие изменения
- Удалены старые сокращённые методы:
send_textsend_markdownsend_message
- Добавлены явные методы по типу адресата:
send_text_to_chat(chat_id, text)send_text_to_user(user_id, text)send_markdown_to_chat(chat_id, text)send_markdown_to_user(user_id, text)send_message_to_chat(chat_id, body)send_message_to_user(user_id, body)
- Миграция приложений со старой
0.1.0:- Заменить
send_text(chat_id, text)наsend_text_to_chat(chat_id, text) - Заменить
send_markdown(chat_id, text)наsend_markdown_to_chat(chat_id, text) - Заменить
send_message(chat_id, body)наsend_message_to_chat(chat_id, body) - Если приложению известен только глобальный MAX
user_id, использовать новые методы*_to_user(...)
- Заменить
Добавлено
- Добавлен
examples/live_api_test.rs— интерактивный harness для проверки реального API, который включает:- выбор языка English / Russian
- ввод токена, URL бота, webhook-настроек, пути к файлу, задержек и таймаутов во время старта
- ручные шаги тестера в клиенте MAX
- необязательный этап группового чата
- итоговую сводку
PASS / FAIL / SKIP - ручное ожидание без
Ctrl+Cчерезcontinue / skip / fail
- Добавлен live-сценарий
/get_my_idи выводsender.user_id - Добавлено live-покрытие новых методов
*_to_chatи*_to_user, включая отправку вложения поuser_id - Добавлены тесты, которые явно проверяют различие между
chat_idиuser_id
Изменено
- Во всей документации явно зафиксировано:
user_id— глобальный идентификатор пользователя MAXchat_id— идентификатор конкретного диалога, группы или канала
- README, README.ru, примеры и crate docs переведены только на явные методы
*_to_chat/*_to_user - Таблицы API перестроены так, чтобы chat-методы и user-методы стояли рядом
- Версия крейта повышена до
1.0.0
Исправлено
- Исправлен
answer_callback: теперьcallback_idотправляется query-параметром, как требует реальный MAX API - Исправлен
edit_message: теперь метод возвращаетSimpleResult, а не пытается неверно десериализоватьMessage - Разбор HTTP-ответов переведён на
bytes + String::from_utf8_lossy, чтобы не падать на невалидном UTF-8 - Добавлена lossy-десериализация вложений: неизвестный или кривой attachment больше не валит весь update или message
- Для действий бота и live-теста закреплено реальное значение MAX
typing_on
Ограничения платформы MAX, выявленные live-тестами
request_contactзадокументирован в MAX, но в live-тестах contact приходил с пустымиcontact_idиvcf_phonerequest_geo_locationзадокументирован в MAX, мобильный клиент показывает отправленную карточку геопозиции, но бот не получил соответствующий update в live pollingtyping_onвозвращает успешный API-ответ, но видимый индикатор набора текста в клиенте live-тестами не подтверждёнset_my_commandsостаётся experimental helper: live-запросыPOST /me/commandsвозвращают404, а публичный REST MAX сейчас не показывает документированного write-эндпоинта для меню команд
Проверка
cargo fmt --allcargo check --example live_api_testcargo test- Живой тест на реальном MAX-боте был успешно пройден в рамках этого релиза
v0.1.0
First release.