diff --git a/Botticelli.Framework.Telegram/TelegramBot.cs b/Botticelli.Framework.Telegram/TelegramBot.cs index 38ff9c5b..a52ea281 100644 --- a/Botticelli.Framework.Telegram/TelegramBot.cs +++ b/Botticelli.Framework.Telegram/TelegramBot.cs @@ -32,6 +32,7 @@ public class TelegramBot : BaseBot private readonly IBotDataAccess _data; private readonly IBotUpdateHandler _handler; private readonly ITextTransformer _textTransformer; + private bool _handlerLoaded = false; protected readonly ITelegramBotClient Client; // ReSharper disable once MemberCanBeProtected.Global @@ -512,13 +513,16 @@ protected override Task InnerStartBotAsync(StartBotRequest req BotStatusKeeper.IsStarted = true; // Rethrowing events from BotUpdateHandler - _handler.MessageReceived += (sender, e) + if (!_handlerLoaded) + { + _handler.MessageReceived += (sender, e) => MessageReceived?.Invoke(sender, e); - _handler.ContactShared += (sender, e) - => ContactShared?.Invoke(sender, e); - _handler.NewChatMembers += (sender, e) - => NewChatMembers?.Invoke(sender, e); - + _handler.ContactShared += (sender, e) + => ContactShared?.Invoke(sender, e); + _handler.NewChatMembers += (sender, e) + => NewChatMembers?.Invoke(sender, e); + _handlerLoaded = true; + } Client.StartReceiving(_handler, cancellationToken: token); Logger.LogInformation($"{nameof(StartBotAsync)}: started"); diff --git a/README.md b/README.md index cff1a249..1084e6ea 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,15 @@ -# Botticelli +# Botticelli ๐Ÿค– โ€“ Universal .NET Framework for AI-Powered Bots + +Logo + +Build smart chatbots in minutes for Telegram, WhatsApp, and beyond. +Seamless integration with ChatGPT, DeepSeek, YandexGPT, databases, queues, speech, and scheduling. +Fully open-source ยท Cross-platform + **Botticelli** framework: a chat bot development platform for .NET [![License](https://img.shields.io/badge/GPL-license-orange)](https://github.com/devgopher/botticelli?tab=GPL-3.0-1-ov-file) -[![Release](https://img.shields.io/badge/Release-0.6-orange)](https://github.com/devgopher/botticelli/releases/tag/0.6) +[![Release](https://img.shields.io/badge/Release-0.8.3-orange)](https://github.com/devgopher/botticelli/releases/tag/v0.8.3) [![Documentations](https://img.shields.io/badge/Documentation-docs-orange.svg?style=flat-square)](http://botticellibots.com/documentation/) [![Youtrack Dashboard](https://img.shields.io/badge/Youtrack-dashboard-orange.svg?style=flat-square)](https://botticelli.youtrack.cloud/dashboard) @@ -10,18 +17,17 @@ [![Telegram](https://img.shields.io/badge/Telegram-channel-orange)](https://t.me/botticelli_bots) **There are several reasons to choose Botticelli:** -- cross-platform -- supports a wide range of messengers (Telegram, Facebook, VK) -- extensible (you may add support of any other messenger, that has an open API) -- reliable -- easy to use -- easy to deploy -- easy to manage/administrate bots -- easy to integrate with **databases** -- easy to integrate with **AI** (**ChatGPT**, **YandexGPT**, **DeepSeek**) solutions (Botticelli.AI) -- easy to integrate with **speech synthesizers** (Botticelli.Talks) -- easy to integrate with queue brokers for highload systems (Botticelli.Bus) -- easy to schedule (Botticelli.Scheduler) + +โœ… **Multi-platform** โ€“ Telegram + custom providers +โœ… **AI integrations out-of-the-box** โ€“ ChatGPT, DeepSeek, YandexGPT, GPT-J +โœ… **Databases & queues** โ€“ SQL/NoSQL + RabbitMQ/Kafka support +โœ… **Voice & speech** โ€“ built-in TTS/STT (Botticelli.Talks) +โœ… **Task scheduler** โ€“ cron jobs & delayed messages +โœ… **Web admin panel** โ€“ monitor and control all bots from one place +โœ… **Minimal boilerplate** โ€“ production bot in 20โ€“50 lines +โœ… **Production-ready** โ€“ Docker, logging, health checks +โœ… **100 % open-source** โ€“ no hidden paid features +โœ… **.NET 8+** โ€“ runs everywhere (Windows / Linux / macOS / ARM) # Getting Started @@ -38,6 +44,27 @@ On a bot side we can implement any business logic we want. ## Application examples +### Air quality bot +Alt Text + [Air quality info bot](https://t.me/air_quality_info_bot) - this Telegram bot gets an air quality for your location [Air quality info bot sources](https://github.com/devgopher/air_quality_bot) - Air quality bot sources + + +### Recipes finder bot +Alt Text + +[Recipes finder bot](https://t.me/cooking_recipes903_bot) - Recipes finder Telegram bot + +[Recipes finder bot sources](https://github.com/devgopher/cookbook_bot) - Recipes finder bot sources + + +### WikiBooks finder bot +Alt Text + +[WikiBooks finder bot](https://t.me/wikibooks_search_bot) - WikiBooks finder Telegram bot + +[WikiBooks finder bot sources](https://github.com/devgopher/wikibooks_bot) - WikiBooks finder bot sources + +[![Star History Chart](https://api.star-history.com/svg?repos=devgopher/botticelli&type=date&legend=top-left)](https://www.star-history.com/#devgopher/botticelli&type=date&legend=top-left)