Skip to content

Commit

Permalink
Update rss.py
Browse files Browse the repository at this point in the history
  • Loading branch information
junedkh committed Oct 3, 2022
1 parent db94319 commit 3e5281f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bot/modules/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from bot.helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot.helper.ext_utils.db_handler import DbManger
from bot.helper.telegram_helper import button_build
from bot.helper.telegram_helper.button_build import ButtonMaker

rss_dict_lock = Lock()

Expand Down Expand Up @@ -133,14 +133,14 @@ def rss_unsub(update, context):
sendMessage(f"Use this format to remove feed url:\n/{BotCommands.RssUnSubCommand[0]} Title", context.bot, update.message)

def rss_settings(update, context):
buttons = button_build.ButtonMaker()
buttons = ButtonMaker()
buttons.sbutton("Unsubscribe All", "rss unsuball")
if rss_job.enabled:
buttons.sbutton("Pause", "rss pause")
else:
buttons.sbutton("Start", "rss start")
if AUTO_DELETE_MESSAGE_DURATION == -1:
buttons.sbutton("Close", f"rss close")
buttons.sbutton("Close", "rss close")
button = buttons.build_menu(1)
setting = sendMarkup('Rss Settings', context.bot, update.message, button)
Thread(target=auto_delete_message, args=(context.bot, update.message, setting)).start()
Expand Down Expand Up @@ -203,7 +203,7 @@ def rss_monitor(context):
break
parse = True
for list in data['filters']:
if not any(x in str(rss_d.entries[feed_count]['title']).lower() for x in list):
if all(x not in str(rss_d.entries[feed_count]['title']).lower() for x in list):
parse = False
feed_count += 1
break
Expand All @@ -225,7 +225,7 @@ def rss_monitor(context):
rss_dict[title].update({'last_feed': last_link, 'last_title': last_title})
DbManger().rss_update(title)
LOGGER.info(f"Feed Name: {title}")
LOGGER.info(f"Last item: {last_feed}")
LOGGER.info(f"Last item: {last_link}")
except Exception as e:
LOGGER.error(f"{e} Feed Name: {title} - Feed Link: {data['link']}")
continue
Expand Down

0 comments on commit 3e5281f

Please sign in to comment.