Skip to content

Releases: bvdcode/TelegramBot.NET

Release 1.0.38

26 Oct 20:22

Choose a tag to compare

Refactor TryMatchMethod for clarity and efficiency

Refactored the `TryMatchMethod` function to improve readability and performance by introducing a fast path for parameterless methods and delegating complex logic to a new helper method `TryExtractArgsFromParts`. The new helper method handles command part matching, placeholder resolution, and type conversion. Updated comments for better maintainability.

Release 1.0.37

26 Oct 18:36

Choose a tag to compare

Refactor method matching logic in InlineQueryHandler

Refactored the method matching logic by replacing `IsValidMethod` with `TryMatchMethod` to improve flexibility and support placeholders in commands. Added helper methods `IsPlaceholder` and `PlaceholderName` for placeholder handling. Enhanced argument parsing with type validation and conversion using `TryConvertToType`. Improved ambiguity handling with detailed error messages for multiple matches. Introduced an exact match shortcut for methods without parameters. Cleaned up code for better readability and maintainability.

Release 1.0.36

29 Jun 10:46

Choose a tag to compare

Add ASP.NET Core project and enhance bot functionality

- Updated solution to include `TelegramBot.AspNetCoreTest`.
- Improved bot controller registration in `ServiceCollectionExtensions.cs`.
- Enhanced method validation in `InlineQueryHandler.cs`.
- Added logging configuration in `appsettings.Development.json` and `appsettings.json`.
- Created `Program.cs` for ASP.NET Core application setup.
- Defined project structure in `TelegramBot.AspNetCoreTest.csproj`.
- Added HTTP request file for API testing.
- Introduced `WeatherForecast.cs` model for weather data.
- Implemented `CounterController.cs` and `PhoneController.cs` for bot commands.
- Added `WeatherForecastController.cs` for weather forecast API endpoint.

Release 1.0.35

29 Jun 09:36

Choose a tag to compare

Refactor bot framework and controller registration

Restructure the TelegramBot application by removing the
`MapControllers` method from the `IBot` interface and
implementing the `AddBotControllers` extension method
in `ServiceCollectionExtensions`. This change allows
for direct registration of bot controllers into the
service collection, enhancing modularity and
maintainability. The `Run` method in `BotApp` has
been simplified, and the `BotControllerMethodsContainer`
is now instantiated within the new extension method.

Release 1.0.34

28 Jun 06:20

Choose a tag to compare

Refactor BotBuilder and enhance TelegramServerBuilder

- Added service registration for IHostApplicationLifetime in BotBuilder.cs to manage application lifetime events.
- Updated documentation for the BotBuilder constructor to clarify its intended use in ASP.NET Core applications.
- Removed previous registration of IHostApplicationLifetime, indicating a refactor of service registrations.
- Introduced UseConfiguration property in TelegramServerBuilder.cs to enhance configurability of the Telegram API base URL.

Release 1.0.33

28 Jun 04:03

Choose a tag to compare

Enhance Telegram bot with new features and improvements

- Updated `HandleStartAsync` in `README.md` to include new command handlers and response types.
- Renamed `adminId` to `chiefUserId` in `CafeController.cs` and modified message handling.
- Added `HandleReceipt` method to generate and return a receipt as text and image.
- Updated `HandleByeAsync` to remove reply keyboard in `QueryController.cs`.
- Registered new `/counter` command in `Program.cs` for both English and Russian.
- Upgraded target framework to `net9.0` and updated package references in `TelegramBot.ConsoleTest.csproj`.
- Refactored `ExecuteResultAsync` methods in `InlineResult.cs` and `MarkdownResult.cs` for performance.
- Added `RemoveReplyKeyboard` property in `TextResult.cs` for better message handling.
- Set console output encoding to UTF-8 in `BotBuilder.cs`.
- Enhanced `BotControllerBase.cs` with new methods for editing messages and combining action results.
- Introduced `CounterController.cs` for managing a simple counter with logging.
- Added new result classes: `DeleteMessageResult`, `ImageResult`, `InlineEditResult`, `MultiActionResult`, and `TextEditResult`.
- Improved `ImageResult` to support stream disposal after sending.

Release 1.0.32

28 Jun 02:35

Choose a tag to compare

Refactor BotApp and introduce TelegramBotHostedService

Significantly refactored the BotApp class to remove direct dependencies on the Telegram.Bot client, now utilizing a BotControllerMethodsContainer for managing controller methods. Introduced the TelegramBotHostedService to handle the bot's lifecycle and update processing. Updated the BotBuilder class to reflect these changes, including renaming the service addition method for clarity. Overall, these modifications enhance modularity, maintainability, and separation of concerns within the codebase.

Release 1.0.31

02 Mar 05:49

Choose a tag to compare

Merge branch 'develop'

Release 1.0.30

21 Feb 08:34

Choose a tag to compare

Add custom HttpClient support to BotConfiguration

Introduce a new property `HttpClient` in the `BotConfiguration` class, allowing for a custom `HttpClient` to be set. If not set, a default `HttpClient` will be used.

Update `BotBuilder` to use this custom `HttpClient` when creating an instance of `TelegramBotClient`. If the `HttpClient` is not provided in the `BotConfiguration`, the default behavior remains unchanged.

Include a `using` directive for `System.Net.Http` in `BotConfiguration` to support the new `HttpClient` property.

Release 1.0.29

15 Dec 00:17

Choose a tag to compare

Add BotConfiguration to control receiving updates

Introduced BotConfiguration class to manage bot settings, including the ReceiveUpdates property. Updated Program.cs to configure BotBuilder with ReceiveUpdates set to false. Modified BotApp and BotBuilder to utilize BotConfiguration for conditional update handling. Refactored UseApiKey method in BotBuilder.