From e2ee98d1f458b6c0c660ab62fa0e245dc7da5303 Mon Sep 17 00:00:00 2001 From: Mike Matiunin Date: Thu, 27 Feb 2025 22:23:52 +0400 Subject: [PATCH] Fix chart data assertion to include chatId parameter --- bin/vixen.dart | 3 +-- lib/src/reports.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/vixen.dart b/bin/vixen.dart index 8947252..71f8ff4 100644 --- a/bin/vixen.dart +++ b/bin/vixen.dart @@ -417,10 +417,9 @@ void sendReportsTimer(Database db, Bot bot, Set chats) { } // Generate the chart - final data = await reports.chartData(from: from, to: to /* chatId: cid, */, random: false); + final data = await reports.chartData(from: from, to: to, chatId: cid, random: false); final chart = await reports.chartPng( data: data, - chatId: cid, width: 720, // 480, // 1280 height: 360, // 240, // 720 ); diff --git a/lib/src/reports.dart b/lib/src/reports.dart index 335b6b5..93caa59 100644 --- a/lib/src/reports.dart +++ b/lib/src/reports.dart @@ -213,7 +213,7 @@ final class Reports { int paddingTop = 24, int paddingBottom = 48, }) async { - assert(data == null || (from == null && to == null), 'Either data or from and to must be null'); + assert(data == null || (from == null && to == null && chatId == null), 'Either data or from and to must be null'); data ??= await chartData( from: from ?? DateTime.now().subtract(const Duration(days: 1)), to: to ?? DateTime.now(), diff --git a/pubspec.yaml b/pubspec.yaml index bf193ab..6e3288d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,7 +8,7 @@ description: "Vixen Telegram Bot" publish_to: "none" -version: 0.5.4 +version: 0.5.5 homepage: https://plugfox.dev