diff options
Diffstat (limited to 'plugin.py')
-rw-r--r-- | plugin.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |