Skip to content

Releases: bvdcode/TelegramBot.NET

Release 1.0.32

Choose a tag to compare

@bvdcode bvdcode released this 28 Jun 02:35
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

Choose a tag to compare

@bvdcode bvdcode released this 02 Mar 05:49
Merge branch 'develop'

Release 1.0.30

Choose a tag to compare

@bvdcode bvdcode released this 21 Feb 08:34
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

Choose a tag to compare

@bvdcode bvdcode released this 15 Dec 00:17
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.

Release 1.0.28

Choose a tag to compare

@bvdcode bvdcode released this 16 Nov 01:25
Refactor methods and update package versions

Replaced `SendTextMessageAsync` with `SendMessage` across multiple files. Changed `ParseMode` in `InlineResult.cs` to non-nullable with default `ParseMode.None`. Updated `Microsoft.EntityFrameworkCore.Sqlite` and `Microsoft.EntityFrameworkCore.Tools` to `9.0.0` in `TelegramBot.ConsoleTest.csproj`. Updated `Telegram.Bot` to `22.0.2` and other packages to `9.0.0` in `TelegramBot.csproj`. Added using directives in `BotApp.cs`. Replaced `GetMeAsync` with `GetMe` in `BotApp.cs`. Adjusted order of operations and refactored `HostApplicationLifetime` logic in `BotApp.cs`. Removed unused using directives.

Release 1.0.27

Choose a tag to compare

@bvdcode bvdcode released this 04 Oct 13:25
Refactor GetMethodInfo and add helper methods

Note: this refactoring 100% AI generated and was not tested

Refactored the GetMethodInfo method to improve readability and modularity by breaking down its logic into smaller, focused methods: IsValidUpdate, GetCommandParts, IsCommandValid, AddArguments, and FindMatchingMethods. The FindMatchingMethods method now returns a list of matching methods and throws an AmbiguousMatchException if multiple methods are found. The ObjectHelpers.TryConvertParameters call has been moved inside FindMatchingMethods, and the _args list is cleared and repopulated with converted arguments if a single matching method is found.

Release 1.0.26

Choose a tag to compare

@bvdcode bvdcode released this 24 Sep 01:10
Improve argument parsing in TextCommandHandler.cs

Refactor the argument parsing logic in TextCommandHandler.cs to
use a List<string> for collecting arguments and a string for
building the current argument. This new implementation correctly
handles quoted arguments by checking if a part starts and ends
with a quote, or if it starts or ends with a quote and continues
to build the argument until the closing quote is found. It also
trims the quotes from the arguments and filters out any empty or
whitespace-only arguments.

Release 1.0.25

Choose a tag to compare

@bvdcode bvdcode released this 24 Sep 00:50
Enhance text command processing in TextCommandHandler.cs

- Add System.Linq namespace for LINQ functionalities.
- Use StringSplitOptions.RemoveEmptyEntries in Split method.
- Implement handling for quoted text within commands.
- Filter out empty or whitespace parts after processing.
- Add early return conditions for empty parts array.

Release 1.0.24

Choose a tag to compare

@bvdcode bvdcode released this 16 Sep 11:29
Merge branch 'main' of https://github.com/BigMakCode/TelegramBot.NET

Release 1.0.23

Choose a tag to compare

@bvdcode bvdcode released this 14 Aug 20:01
Merge branch 'main' of https://github.com/BigMakCode/TelegramBot.NET