Fixes #28
2
rss.py
2
rss.py
|
@ -7,7 +7,7 @@ class FeedItem:
|
||||||
self.title = item.get('title', '')
|
self.title = item.get('title', '')
|
||||||
self.description = item.get('summary', '')
|
self.description = item.get('summary', '')
|
||||||
if 'published' in item:
|
if 'published' in item:
|
||||||
self.date = item.published_parsed()
|
self.date = item.published_parsed
|
||||||
else:
|
else:
|
||||||
self.date = None
|
self.date = None
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class CommandProcessor:
|
||||||
|
|
||||||
self.bot.infinity_polling()
|
self.bot.infinity_polling()
|
||||||
|
|
||||||
def __command_help(self, message: Message):
|
def __command_help(self, message: Message, data: dict):
|
||||||
self.bot.reply_to(
|
self.bot.reply_to(
|
||||||
message,
|
message,
|
||||||
'Supported commands:\n'
|
'Supported commands:\n'
|
||||||
|
@ -59,7 +59,7 @@ class CommandProcessor:
|
||||||
|
|
||||||
feed_list = ''
|
feed_list = ''
|
||||||
for index, feed in enumerate(feeds, start=1):
|
for index, feed in enumerate(feeds, start=1):
|
||||||
feed_list += '* ' + str(index) + ': ' + f'''<a href="{feed['url']}">{feed['title']}</a>''' + '\n'
|
feed_list += str(index) + ': ' + f"{feed['url']}" + '\n'
|
||||||
|
|
||||||
self.bot.reply_to(message, 'Your feeds:\n' + feed_list)
|
self.bot.reply_to(message, 'Your feeds:\n' + feed_list)
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ class Notifier:
|
||||||
return (
|
return (
|
||||||
f"<strong><a href=\"{item.url}\">{item.title}</a></strong>\n\n"
|
f"<strong><a href=\"{item.url}\">{item.title}</a></strong>\n\n"
|
||||||
f"{item.date}\n"
|
f"{item.date}\n"
|
||||||
f"{item.description}"
|
# f"{item.description}"
|
||||||
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@ from rss import RssReader
|
||||||
from update_manager import UpdateManager
|
from update_manager import UpdateManager
|
||||||
from database import Database
|
from database import Database
|
||||||
from telegram import Notifier
|
from telegram import Notifier
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
token = os.getenv('TELEGRAM_TOKEN')
|
token = os.getenv('TELEGRAM_TOKEN')
|
||||||
db_path = os.getenv('DATABASE_PATH')
|
db_path = os.getenv('DATABASE_PATH')
|
||||||
|
|
Loading…
Reference in a new issue
We need to create a task for that.