diff --git a/modules/rnd.py b/modules/rnd.py index ff27634..24b2e26 100644 --- a/modules/rnd.py +++ b/modules/rnd.py @@ -9,4 +9,7 @@ def load(context): add_hook("cmd_hook", Hook(cmd_choice, "choice")) def cmd_choice(msg): - return Response(msg.sender, random.choice(msg.cmds[1:]), channel=msg.channel, nick=msg.nick) + 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!")