Skip to content

Commit

Permalink
[admin] Fix handling of part messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-koivula committed Jun 6, 2013
1 parent 784fa67 commit 986ca3c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ def part(bot, trigger):
# Can only be done in privmsg by an admin
if trigger.sender.startswith('#'):
return
if trigger.admin:
part_msg = trigger.group(2).strip()
bot.part(part_msg)
if not trigger.admin:
return

channel, _sep, part_msg = trigger.group(2).partition(' ')
if part_msg:
bot.part(channel, part_msg)
else:
bot.part(channel)


@willie.module.commands('quit')
Expand Down

0 comments on commit 986ca3c

Please sign in to comment.