From 5184b71b27fd5a52edd91d008d701cc12caa10ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Tue, 14 Dec 2021 01:11:07 +0100 Subject: [PATCH] Move stats to own command --- discord_rss_bot/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/discord_rss_bot/main.py b/discord_rss_bot/main.py index 84b7962..abf678c 100644 --- a/discord_rss_bot/main.py +++ b/discord_rss_bot/main.py @@ -53,8 +53,7 @@ def add( @app.command() -def check() -> None: - """Check new entries for every feed""" +def stats() -> None: with closing(make_reader(Settings.db_file)) as reader: feed_count = reader.get_feed_counts() entry_count = reader.get_entry_counts() @@ -78,6 +77,11 @@ def check() -> None: 12 Months: {entry_count.averages[2]:.2f} entries per day""" ) + +@app.command() +def check() -> None: + """Check new entries for every feed""" + with closing(make_reader(Settings.db_file)) as reader: # Update the feeds reader.update_feeds()