New module rnd to make choice
This commit is contained in:
parent
81db3de0df
commit
dfa4c49d68
12
modules/rnd.py
Normal file
12
modules/rnd.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# coding=utf-8
|
||||||
|
|
||||||
|
import random
|
||||||
|
|
||||||
|
nemubotversion = 3.3
|
||||||
|
|
||||||
|
def load(context):
|
||||||
|
from hooks import Hook
|
||||||
|
add_hook("cmd_hook", Hook(cmd_choice, "choice"))
|
||||||
|
|
||||||
|
def cmd_choice(msg):
|
||||||
|
return Response(msg.sender, random.choice(msg.cmds[1:]), channel=msg.channel)
|
Loading…
x
Reference in New Issue
Block a user