From 7798c5c39f4a41a9c3af6caf9ad05539b47b1041 Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Sun, 8 Sep 2024 13:15:36 +0530 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=8D=EF=B8=8F=20Updated=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5d32bd0..55801fc 100644 --- a/README.md +++ b/README.md @@ -391,14 +391,14 @@ class AutoReplyEnforcer implements Transformer { @override Future> transform( APICaller call, - APIMethod method, - Payload payload, - ) async { + APIMethod method, [ + Payload? payload, + ]) async { final isSendMethod = APIMethod.sendMethods.contains(method); final isNotChatAction = method != APIMethod.sendChatAction; if (isSendMethod && isNotChatAction) { - payload.params["reply_markup"] = ForceReply().toJson(); + payload!.params["reply_markup"] = ForceReply().toJson(); } return await call(method, payload); From f20f6098151b13bc1f1e5785f5c65997f1df37f8 Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Thu, 12 Sep 2024 12:30:26 +0530 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=87=20Setting=20stream=20controlle?= =?UTF-8?q?rs=20in=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/televerse/bot/bot.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/televerse/bot/bot.dart b/lib/src/televerse/bot/bot.dart index 7b13c17..549ff8e 100644 --- a/lib/src/televerse/bot/bot.dart +++ b/lib/src/televerse/bot/bot.dart @@ -248,6 +248,17 @@ class Bot { } catch (err, st) { _handleTheGetMeError(err, st); } + + // Set stream controllers + if (fetcher._updateStreamController == null || + fetcher._updateStreamController?.isClosed == true) { + fetcher._updateStreamController = StreamController.broadcast(); + } + if (fetcher._updatesStreamController == null || + fetcher._updatesStreamController?.isClosed == true) { + fetcher._updatesStreamController = + StreamController>.broadcast(); + } // Set instance variable _instance = this; } @@ -598,7 +609,6 @@ class Bot { await _initializeBot(); } - fetcher._updateStreamController = StreamController.broadcast(); fetcher._updateSubscription = fetcher.onUpdate().listen( _onUpdate, onDone: _onStop, From 2f00971cdba9bb37d6bf75b74c164bc37141f7a7 Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Thu, 12 Sep 2024 12:38:31 +0530 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=9A=80=20Version=20&=20Changelogs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c3b16..69ad291 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.26.1 + +- Fix [#294](https://github.com/xooniverse/televerse/issues/294). +- Updated the Bot.init method to initalize the update streams as well. + # 1.26.0 - [⚠️ Breaking | Plugins] Updated the `Transformer` class diff --git a/pubspec.yaml b/pubspec.yaml index ec9423a..eef6412 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: televerse description: Televerse lets you create your own efficient Telegram bots with ease in Dart. Supports latest Telegram Bot API - 7.10! -version: 1.26.0 +version: 1.26.1 homepage: https://televerse.xooniverse.com repository: https://github.com/xooniverse/televerse topics: