nemubot/modules/rnd.py
2015-08-26 12:18:20 +02:00

23 lines
439 B
Python

# coding=utf-8
"""Help to make choice"""
import random
from nemubot.exception import IRCException
from nemubot.hooks import hook
nemubotversion = 3.4
from more import Response
@hook("cmd_hook", "choice")
def cmd_choice(msg):
if not len(msg.args):
raise IRCException("indicate some terms to pick!")
return Response(random.choice(msg.args),
channel=msg.channel,
nick=msg.nick)