From 00a7df7d842a7eab454ecda7328091724fd6bec9 Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Sat, 24 Oct 2026 21:55:57 +0300 Subject: [PATCH 1/3] test: fix incorrect endpoints --- tests/Max.Bot.Tests/Unit/Api/BotApiTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Max.Bot.Tests/Unit/Api/BotApiTests.cs b/tests/Max.Bot.Tests/Unit/Api/BotApiTests.cs index 89b3a1a..32e5e66 100644 --- a/tests/Max.Bot.Tests/Unit/Api/BotApiTests.cs +++ b/tests/Max.Bot.Tests/Unit/Api/BotApiTests.cs @@ -245,7 +245,7 @@ public async Task SetCommandsAsync_ShouldReturnUser_WhenRequestSucceeds() .Setup(x => x.SendAsyncRaw( It.Is(req => req.Method == HttpMethod.Patch && - req.Endpoint == "/me" && + req.Endpoint == "/me/commands" && req.Headers != null && req.Headers.ContainsKey("Authorization") && req.Headers["Authorization"] == "test-token-123" && @@ -267,7 +267,7 @@ public async Task SetCommandsAsync_ShouldReturnUser_WhenRequestSucceeds() x => x.SendAsyncRaw( It.Is(req => req.Method == HttpMethod.Patch && - req.Endpoint == "/me"), + req.Endpoint == "/me/commands"), It.IsAny()), Times.Once); } From e7436eda64fae349d28d452c9c10e1e48158c49a Mon Sep 17 00:00:00 2001 From: Denis Titovets Date: Sat, 24 Oct 2026 21:59:07 +0300 Subject: [PATCH 2/3] fix: correct endpoint in `SetCommandsAsync()` --- src/Max.Bot/Api/BotApi.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Max.Bot/Api/BotApi.cs b/src/Max.Bot/Api/BotApi.cs index 6fa0cef..b118fea 100644 --- a/src/Max.Bot/Api/BotApi.cs +++ b/src/Max.Bot/Api/BotApi.cs @@ -45,7 +45,7 @@ public async Task SetCommandsAsync(IEnumerable commands, Cance Commands = commands.ToArray() }; - var request = CreateRequest(HttpMethod.Patch, "/me", updateRequest); + var request = CreateRequest(HttpMethod.Patch, "/me/commands", updateRequest); return await ExecuteRequestAsync(request, cancellationToken).ConfigureAwait(false); } } From 6cd09df94f493271db2747dad9abcbb6f75b1965 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 12:34:58 +0000 Subject: [PATCH 3/3] =?UTF-8?q?release:=20v0.7.1-alpha=20=E2=80=94=20SetCo?= =?UTF-8?q?mmandsAsync=20uses=20PATCH=20/me/commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update XML docs for the new endpoint, note that the response only carries the command list, bump version and changelog. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01L3D2HPfoaUhhxeeP7u79XL --- CHANGELOG.md | 9 ++++++++- src/Max.Bot/Api/IBotApi.cs | 6 +++--- src/Max.Bot/Max.Bot.csproj | 2 +- src/Max.Bot/Types/Requests/UpdateBotInfoRequest.cs | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c89754e..5544849 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.7.1-alpha] - 2026-10-27 + +### Fixed + +- **Bot commands** (#41, #42): `SetCommandsAsync` отправляет запрос на `PATCH /me/commands` вместо `PATCH /me` — MAX больше не принимает `PATCH /me` и отвечал `Path /me is not recognized`. Эндпоинт отвечает только списком команд, поэтому в возвращаемом `User` заполнено лишь `Commands`. Спасибо @diquoks! + ## [0.7.0-alpha] - 2026-10-11 Ревью всей библиотеки на соответствие MAX Bot API (схемы официального Go SDK `max-bot-api-client-go`) и исправление открытых issue. @@ -383,7 +389,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 --- -[Unreleased]: https://github.com/NanoAgents/MaxBotNet/compare/v0.7.0-alpha...HEAD +[Unreleased]: https://github.com/NanoAgents/MaxBotNet/compare/v0.7.1-alpha...HEAD +[0.7.1-alpha]: https://github.com/NanoAgents/MaxBotNet/compare/v0.7.0-alpha...v0.7.1-alpha [0.7.0-alpha]: https://github.com/NanoAgents/MaxBotNet/compare/v0.6.3-alpha...v0.7.0-alpha [0.6.3-alpha]: https://github.com/NanoAgents/MaxBotNet/compare/v0.6.2-alpha...v0.6.3-alpha [0.6.2-alpha]: https://github.com/NanoAgents/MaxBotNet/compare/v0.6.1-alpha...v0.6.2-alpha diff --git a/src/Max.Bot/Api/IBotApi.cs b/src/Max.Bot/Api/IBotApi.cs index 3424236..cc8dc14 100644 --- a/src/Max.Bot/Api/IBotApi.cs +++ b/src/Max.Bot/Api/IBotApi.cs @@ -37,14 +37,14 @@ public interface IBotApi /// /// The collection of commands to set. /// A cancellation token to cancel the operation. - /// A task that represents the asynchronous operation. The task result contains the updated bot user information. + /// A task that represents the asynchronous operation. The task result contains the updated bot commands in ; other properties are not returned by this endpoint. /// Thrown when commands is null. /// Thrown when the API returns an error response. /// Thrown when a network error occurs. /// Thrown when authentication fails. /// - /// This method uses the PATCH /me endpoint to update bot commands. - /// See: https://dev.max.ru/docs-api/methods/PATCH/me + /// This method uses the PATCH /me/commands endpoint to update bot commands. + /// See: https://dev.max.ru/docs-api/methods/PATCH/me/commands /// Task SetCommandsAsync(IEnumerable commands, CancellationToken cancellationToken = default); } diff --git a/src/Max.Bot/Max.Bot.csproj b/src/Max.Bot/Max.Bot.csproj index c484498..899205b 100644 --- a/src/Max.Bot/Max.Bot.csproj +++ b/src/Max.Bot/Max.Bot.csproj @@ -5,7 +5,7 @@ enable MaxMessenger.Bot - 0.7.0-alpha + 0.7.1-alpha MaxBotNet Contributors C# library for Max Messenger Bot API (.NET 10, .NET 9, .NET 8) Apache-2.0 diff --git a/src/Max.Bot/Types/Requests/UpdateBotInfoRequest.cs b/src/Max.Bot/Types/Requests/UpdateBotInfoRequest.cs index ea23001..c914f38 100644 --- a/src/Max.Bot/Types/Requests/UpdateBotInfoRequest.cs +++ b/src/Max.Bot/Types/Requests/UpdateBotInfoRequest.cs @@ -3,7 +3,7 @@ namespace Max.Bot.Types.Requests; /// -/// Represents a request to update bot information via PATCH /me. +/// Represents a request to update bot commands via PATCH /me/commands. /// public class UpdateBotInfoRequest {