Be more verbose when bad heading arguments are supplied.
authorCMDR furrycat <elite@furrycat.net>
Fri, 9 Nov 2018 08:43:17 +0000 (08:43 +0000)
committerCMDR furrycat <elite@furrycat.net>
Fri, 9 Nov 2018 08:43:17 +0000 (08:43 +0000)
plugin/heading/heading.py

index ecbaddb..489fe9b 100644 (file)
@@ -35,6 +35,8 @@ class Heading(object):
       yield from self.help_heading(message)
     elif command in ['from', 'to']:
       yield from self.navigate(message, args)
+    else:
+      yield from bot.say(message.channel, '?')
 
   @asyncio.coroutine
   def help_heading(self, message, *args):
@@ -93,6 +95,11 @@ class Heading(object):
       else:
         break
 
+    for k in ['from', 'to']:
+      if k not in parsed:
+        yield from bot.say(message.channel, '{} where?'.format(k))
+        return None
+
     if not ok:
       log.info('Failed to parse heading.  Got: {}'.format(parsed))
       yield from bot.say(message.channel, '{}?'.format(arg))