From 1478b3bb3220a66d11f925dc39396073ae00ae02 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 12 Aug 2019 12:37:47 +0100 Subject: [PATCH] `!rss read` will assume url if there's only url registered for the channel --- modules/rss.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/rss.py b/modules/rss.py index 432f97f3..ed2cc044 100644 --- a/modules/rss.py +++ b/modules/rss.py @@ -155,10 +155,16 @@ class Module(ModuleManager.BaseModule): changed = True message = "Removed RSS feed" elif subcommand == "read": + url = None if not len(event["args_split"]) > 1: - raise utils.EventError("Please provide a url") + if len(rss_hooks) == 1: + url = rss_hooks[0] + else: + raise utils.EventError("Please provide a url") + else: + url = event["args_split"][1] - title, entries = self._get_entries(event["args_split"][1]) + title, entries = self._get_entries(url) if not entries: raise utils.EventError("Failed to get RSS entries")