2013-01-07 11:22:07 +00:00
|
|
|
# coding=utf-8
|
|
|
|
|
|
|
|
import random
|
|
|
|
|
2014-08-12 18:10:19 +00:00
|
|
|
from hooks import hook
|
2013-01-07 11:22:07 +00:00
|
|
|
|
2014-08-13 13:53:55 +00:00
|
|
|
nemubotversion = 3.4
|
2013-01-07 11:22:07 +00:00
|
|
|
|
2014-08-12 18:10:19 +00:00
|
|
|
@hook("cmd_hook", "choice")
|
2013-01-07 11:22:07 +00:00
|
|
|
def cmd_choice(msg):
|
2014-08-06 14:10:10 +00:00
|
|
|
if len(msg.cmds) > 1:
|
|
|
|
return Response(msg.sender, random.choice(msg.cmds[1:]), channel=msg.channel, nick=msg.nick)
|
|
|
|
else:
|
|
|
|
raise IRCException("indicate some terms to pick!")
|