Silly parsing errors.
authorCMDR furrycat <elite@furrycat.net>
Wed, 12 Oct 2016 20:15:00 +0000 (21:15 +0100)
committerCMDR furrycat <elite@furrycat.net>
Wed, 12 Oct 2016 20:15:00 +0000 (21:15 +0100)
bot.py

diff --git a/bot.py b/bot.py
index 7ffa49b..8e17d09 100755 (executable)
--- a/bot.py
+++ b/bot.py
@@ -413,7 +413,7 @@ def show_help(message, *args):
 
   if command is None:
     lines = [
-      '<@{}>, the cat-like robot from the 34th century of the future, recognises these commands (and more)'.format(client.user.id),
+      '<@{}>, the cat-like robot from the 34th century of the future, recognises these commands (and more):'.format(client.user.id),
       '```',
       'announce',
       'coords',
@@ -428,7 +428,7 @@ def show_help(message, *args):
       'raikogram',
       'time',
       '```',
-      'Send help COMMAND` for help on a specific command.'
+      'Send `help COMMAND` for help on a specific command.'
     ]
   elif command == 'announce' or command == 'announcement':
     if len(args) > 1:
@@ -1110,7 +1110,7 @@ def show_announcement(message, id):
 def create_announcement(message, raw):
   # announcement create [params]: <text>
   # We want to split by colon but don't want to count any which are part of dates or URLs.
-  m = re.match(r'(?:[^:]*\s+(?:(?:at|from|to)\s+\d\d\d\d-?\d\d-?\d\d(?:T|\s+)\d\d:?\d\d:?\d\dZ?|sound\s+https?:\S+))+', raw, re.IGNORECASE)
+  m = re.match(r'(?:[^:]*\s+(?:(?:at|from|to)\s+"?\d\d\d\d-?\d\d-?\d\d(?:T|\s+)\d\d:?\d\d:?\d\dZ?"?|sound\s+https?:\S+))+', raw, re.IGNORECASE)
   if m is not None:
     parts = raw[len(m.group(0)):].split(':')
     parts[0] = m.group(0) + parts[0]
@@ -1173,7 +1173,7 @@ def create_announcement(message, raw):
       else:
         m = re.match(r'<@((?:&?|#)\d+)>', param)
         if m is None:
-          m = re.match('r@((?:&?|#)\d+)', param)
+          m = re.match(r'@((?:&?|#)\d+)', param)
           if m is None:
             m = re.match('r@(everyone|here)', param)
         if m is not None: