!rss read will assume url if there's only url registered for the channel

This commit is contained in:
jesopo 2019-08-12 12:37:47 +01:00
parent cf76cd4991
commit 1478b3bb32

View file

@ -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:
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")