@asyncio.coroutine
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.
- 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?)+', raw)
+ # 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)
if m is not None:
parts = raw[len(m.group(0)):].split(':')
parts[0] = m.group(0) + parts[0]