From 7ef084bdde18b4cd7e45093526e64d1ef716d93c Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 30 Sep 2010 01:09:00 +0000 Subject: Allow dashes in startmeeting command --- diff --git a/plugin.py b/plugin.py index ace7efd..b8a77a2 100644 --- a/plugin.py +++ b/plugin.py @@ -35,6 +35,7 @@ import supybot.ircutils as ircutils import supybot.callbacks as callbacks import supybot.ircmsgs as ircmsgs +import re import time import meeting import supybotconfig @@ -54,6 +55,7 @@ except NameError: meeting_cache = {} try: recent_meetings except NameError: recent_meetings = [ ] +command_RE = re.compile(r'#([\w-]+)[ \t]*$') class MeetBot(callbacks.Plugin): """Add the help for "@plugin help MeetBot" here @@ -89,8 +91,15 @@ class MeetBot(callbacks.Plugin): Mkey = (channel,network) M = meeting_cache.get(Mkey, None) + matchobj = command_RE.match(payload) + if matchobj is not None: + command = matchobj.groups()[0] + command = ''.join([i for i in command.lower() if i != '-']) + else: + command = None + # Start meeting if we are requested - if payload[:13] == '#startmeeting': + if command == 'startmeeting': if M is not None: irc.error("Can't start another meeting, one is in progress.") return -- cgit v0.9.1