From 7c373c8f782e9c90ddc84766bb9543f09cdfdb37 Mon Sep 17 00:00:00 2001 From: Miroslavsckaya Date: Sat, 9 Jul 2022 02:49:12 +0300 Subject: [PATCH] Fixes (#28) Reviewed-on: https://git.skobk.in/Miroslavsckaya/tg_rss_bot/pulls/28 Reviewed-by: Alexey Skobkin --- rss.py | 2 +- telegram.py | 6 +++--- update.py | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rss.py b/rss.py index 514bb8d..02f9dad 100644 --- a/rss.py +++ b/rss.py @@ -7,7 +7,7 @@ class FeedItem: self.title = item.get('title', '') self.description = item.get('summary', '') if 'published' in item: - self.date = item.published_parsed() + self.date = item.published_parsed else: self.date = None diff --git a/telegram.py b/telegram.py index 74ef36a..6ed57d2 100644 --- a/telegram.py +++ b/telegram.py @@ -31,7 +31,7 @@ class CommandProcessor: self.bot.infinity_polling() - def __command_help(self, message: Message): + def __command_help(self, message: Message, data: dict): self.bot.reply_to( message, 'Supported commands:\n' @@ -59,7 +59,7 @@ class CommandProcessor: feed_list = '' for index, feed in enumerate(feeds, start=1): - feed_list += '* ' + str(index) + ': ' + f'''{feed['title']}''' + '\n' + feed_list += str(index) + ': ' + f"{feed['url']}" + '\n' self.bot.reply_to(message, 'Your feeds:\n' + feed_list) @@ -132,7 +132,7 @@ class Notifier: return ( f"{item.title}\n\n" f"{item.date}\n" - f"{item.description}" + # f"{item.description}" ) diff --git a/update.py b/update.py index c2c3624..48dca8d 100644 --- a/update.py +++ b/update.py @@ -3,6 +3,9 @@ from rss import RssReader from update_manager import UpdateManager from database import Database from telegram import Notifier +from dotenv import load_dotenv + +load_dotenv() token = os.getenv('TELEGRAM_TOKEN') db_path = os.getenv('DATABASE_PATH')