Format non-default feed parameters.
authorCMDR furrycat <elite@furrycat.net>
Tue, 6 Dec 2016 08:21:22 +0000 (08:21 +0000)
committerCMDR furrycat <elite@furrycat.net>
Tue, 6 Dec 2016 08:21:22 +0000 (08:21 +0000)
plugin/feeds/feeds.py

index 92e4956..0b34ec6 100644 (file)
@@ -356,10 +356,14 @@ class Feeds(DBConnection):
     text += ' in <#{}>'.format(feed['channel_id'])
     if feed['interval']:
       text += ' every {}'.format(bot.unparse_seconds(int(feed['interval'])))
-    text += ' date {}'.format(feed['date'])
-    text += ' summary {}'.format(feed['summary'])
-    text += ' link {}'.format(feed['show_link'])
-    text += ' permissions {}'.format(feed['permissions'])
+    if not bot.parse_boolean(feed['date']):
+      text += ' date {}'.format(feed['date'])
+    if bot.parse_boolean(feed['summary']):
+      text += ' summary {}'.format(feed['summary'])
+    if not bot.parse_boolean(feed['show_link']):
+      text += ' link {}'.format(feed['show_link'])
+    if not bot.parse_boolean(feed['permissions']):
+      text += ' permissions {}'.format(feed['permissions'])
     if feed['link_json']:
       text += "--link_json '{}'".format(feed['link_json'])
     lines.append(text)