Skip to content

vNext: Extensions, DI Examples, ActionManager & Serialization Upgrades

Latest
Compare
Choose a tag to compare
@MajMcCloud MajMcCloud released this 28 Jun 12:19
· 6 commits to master since this release
f95b0e8

Major Highlights

1. New Examples and Dependency Injection

  • Dependency Injection Example Added:

    • New project Examples/DependencyInjection demonstrating full dependency injection with Entity Framework Core (BotDbContext, User model, DI setup).
    • Shows forms using injected database context for user management and state.
  • New Middleware Example:

    • Examples/MiddlewareBaseBot and associated forms demonstrate advanced message loop handling and middleware capabilities.

2. Action Manager Extension

  • New Project: TelegramBotBase.Extensions.ActionManager
    • Provides an "Action Manager" for handling unhandled bot actions/callbacks, including navigation and value parsing.
    • Supports custom actions for strings, integers, GUIDs, and navigation patterns (start with, end with, etc.).
    • Includes detailed documentation on usage and extensibility.

3. PostgreSQL & Legacy JSON Session Serializers

  • New Extension: TelegramBotBase.Extensions.Serializer.Database.PostgreSql
    • Enables session serialization and state management using PostgreSQL.
    • Includes code, SQL schema, and documentation.
  • New Extension: TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson
    • Allows state serialization using Newtonsoft.Json for legacy compatibility.

4. Image Extensions for IronSoftware

  • New Project: TelegramBotBase.Extensions.Images.IronSoftware
    • Enables platform-independent image sending using IronSoftware’s drawing library.
    • Adds helper methods for both AnyBitmap and ImageSharp images.

5. Other New Example Projects

  • FileWatcher Example:
    • Monitors directory changes and sends Telegram messages on file events.
  • MiddlewareBaseBot, InlineAndReplyCombination, SystemCommandsBot, etc.:
    • Several example bots updated or added to demonstrate features and integration patterns.

Upgrades and Improvements

  • Nuget Packages Updated:
    • Many .csproj files upgraded to use the latest versions of TelegramBotBase, EntityFrameworkCore, and other dependencies.
  • Project Structure Enhanced:
    • Consistent use of package references over project references for TelegramBotBase in most example projects.
    • Added new README content, badges, and links for various packages and extension modules.

Documentation

  • README.md Expanded:

    • New sections on Action Manager, Localizations, PostgreSQL/MSSQL/Legacy serializers, and all new example projects.
    • Added links to Discord and Telegram support groups.
    • Detailed usage instructions for new extensions and features.
  • New README files:

    • Each extension and major new subproject now has its own README with installation, usage, and feature documentation.

Miscellaneous

  • License Updated:
    • Copyright year updated to 2025.
  • Localization Updates:
    • Added documentation and support for multiple language localizations.
  • Bugfixes and Internal Improvements:
    • Various improvements to serialization, error messages, and internal extension methods.

Notable New Files and Projects

  • TelegramBotBase.Extensions.ActionManager/ (new extension)
  • TelegramBotBase.Extensions.Serializer.Database.PostgreSql/
  • TelegramBotBase.Extensions.Images.IronSoftware/
  • TelegramBotBase.Extensions.Serializer.Legacy.NewtonsoftJson/
  • Examples/DependencyInjection/
  • Examples/FileWatcher/
  • Examples/MiddlewareBaseBot/