Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Televerse v1.26.1 #295

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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);
12 changes: 11 additions & 1 deletion lib/src/televerse/bot/bot.dart
Original file line number Diff line number Diff line change
@@ -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;
}
@@ -598,7 +609,6 @@ class Bot<CTX extends Context> {
await _initializeBot();
}

fetcher._updateStreamController = StreamController<Update>.broadcast();
fetcher._updateSubscription = fetcher.onUpdate().listen(
_onUpdate,
onDone: _onStop,
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: