Handle attempt to edit with no parameters.
authorCMDR furrycat <elite@furrycat.net>
Sun, 23 Oct 2016 22:44:32 +0000 (23:44 +0100)
committerCMDR furrycat <elite@furrycat.net>
Sun, 23 Oct 2016 22:44:32 +0000 (23:44 +0100)
bot.py

diff --git a/bot.py b/bot.py
index c187314..183921f 100755 (executable)
--- a/bot.py
+++ b/bot.py
@@ -1519,6 +1519,10 @@ def edit_announcement(message, raw):
   if not announce:
     return
 
+  if not len(update.keys()):
+    yield from say(message.channel, '?')
+    return
+
   if db.update_announcement(client, id, **update):
     log.info('Edited announcement {}: {}'.format(id, update))
     yield from say(message.channel, ', '.join([announcement_key(k) for k in update]))
@@ -2064,6 +2068,10 @@ def edit_feed(message, raw):
   if not feed:
     return
 
+  if not len(update.keys()):
+    yield from say(message.channel, '?')
+    return
+
   if db.update_feed(client, id, **update):
     log.info('Edited feed {}: {}'.format(id, update))
     yield from say(message.channel, ', '.join([feed_key(k) for k in update]))