Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Max.Bot/Api/BotApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task<User> SetCommandsAsync(IEnumerable<BotCommand> commands, Cance
Commands = commands.ToArray()
};

var request = CreateRequest(HttpMethod.Patch, "/me", updateRequest);
var request = CreateRequest(HttpMethod.Patch, "/me/commands", updateRequest);
return await ExecuteRequestAsync<User>(request, cancellationToken).ConfigureAwait(false);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Max.Bot/Api/IBotApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public interface IBotApi
/// </summary>
/// <param name="commands">The collection of commands to set.</param>
/// <param name="cancellationToken">A cancellation token to cancel the operation.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated bot user information.</returns>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated bot commands in <see cref="User.Commands"/>; other <see cref="User"/> properties are not returned by this endpoint.</returns>
/// <exception cref="ArgumentNullException">Thrown when commands is null.</exception>
/// <exception cref="Max.Bot.Exceptions.MaxApiException">Thrown when the API returns an error response.</exception>
/// <exception cref="Max.Bot.Exceptions.MaxNetworkException">Thrown when a network error occurs.</exception>
/// <exception cref="Max.Bot.Exceptions.MaxUnauthorizedException">Thrown when authentication fails.</exception>
/// <remarks>
/// <para>This method uses the PATCH /me endpoint to update bot commands.</para>
/// <para>See: https://dev.max.ru/docs-api/methods/PATCH/me</para>
/// <para>This method uses the PATCH /me/commands endpoint to update bot commands.</para>
/// <para>See: https://dev.max.ru/docs-api/methods/PATCH/me/commands</para>
/// </remarks>
Task<User> SetCommandsAsync(IEnumerable<BotCommand> commands, CancellationToken cancellationToken = default);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Max.Bot/Max.Bot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>

<PackageId>MaxMessenger.Bot</PackageId>
<Version>0.7.0-alpha</Version>
<Version>0.7.1-alpha</Version>
<Authors>MaxBotNet Contributors</Authors>
<Description>C# library for Max Messenger Bot API (.NET 10, .NET 9, .NET 8)</Description>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
Expand Down
2 changes: 1 addition & 1 deletion src/Max.Bot/Types/Requests/UpdateBotInfoRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Max.Bot.Types.Requests;

/// <summary>
/// Represents a request to update bot information via PATCH /me.
/// Represents a request to update bot commands via PATCH /me/commands.
/// </summary>
public class UpdateBotInfoRequest
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Max.Bot.Tests/Unit/Api/BotApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public async Task SetCommandsAsync_ShouldReturnUser_WhenRequestSucceeds()
.Setup(x => x.SendAsyncRaw(
It.Is<MaxApiRequest>(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" &&
Expand All @@ -267,7 +267,7 @@ public async Task SetCommandsAsync_ShouldReturnUser_WhenRequestSucceeds()
x => x.SendAsyncRaw(
It.Is<MaxApiRequest>(req =>
req.Method == HttpMethod.Patch &&
req.Endpoint == "/me"),
req.Endpoint == "/me/commands"),
It.IsAny<CancellationToken>()),
Times.Once);
}
Expand Down
Loading