Skip to content

Commit

Permalink
🚀 Merge #295: Televerse v1.26.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HeySreelal committed Sep 12, 2024
2 parents b88ce46 + 2f00971 commit d46cd8f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,14 @@ class AutoReplyEnforcer implements Transformer {
@override
Future<Map<String, dynamic>> 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);
Expand Down
12 changes: 11 additions & 1 deletion lib/src/televerse/bot/bot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,17 @@ class Bot<CTX extends Context> {
} catch (err, st) {
_handleTheGetMeError(err, st);
}
// Set stream controllers
if (fetcher._updateStreamController == null ||
fetcher._updateStreamController?.isClosed == true) {
fetcher._updateStreamController = StreamController<Update>.broadcast();
}
if (fetcher._updatesStreamController == null ||
fetcher._updatesStreamController?.isClosed == true) {
fetcher._updatesStreamController =
StreamController<List<Update>>.broadcast();
}
// Set instance variable
_instance = this;
}
Expand Down Expand Up @@ -598,7 +609,6 @@ class Bot<CTX extends Context> {
await _initializeBot();
}
fetcher._updateStreamController = StreamController<Update>.broadcast();
fetcher._updateSubscription = fetcher.onUpdate().listen(
_onUpdate,
onDone: _onStop,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit d46cd8f

Please sign in to comment.