Skip to content

Commit

Permalink
Fix chart data assertion to include chatId parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Feb 27, 2025
1 parent 5c090b2 commit e2ee98d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions bin/vixen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,9 @@ void sendReportsTimer(Database db, Bot bot, Set<int> 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
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/reports.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "Vixen Telegram Bot"

publish_to: "none"

version: 0.5.4
version: 0.5.5

homepage: https://plugfox.dev

Expand Down

0 comments on commit e2ee98d

Please sign in to comment.