First :D
This commit is contained in:
commit
37588421f3
100 changed files with 22673 additions and 0 deletions
17
plugins/choose.py
Normal file
17
plugins/choose.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import re
|
||||
import random
|
||||
|
||||
from util import hook
|
||||
|
||||
|
||||
@hook.command
|
||||
def choose(inp):
|
||||
".choose <choice1>, <choice2>, ... <choicen> -- makes a decision"
|
||||
|
||||
c = re.findall(r'([^,]+)', inp)
|
||||
if len(c) == 1:
|
||||
c = re.findall(r'(\S+)', inp)
|
||||
if len(c) == 1:
|
||||
return 'the decision is up to you'
|
||||
|
||||
return random.choice(c).strip()
|
Reference in a new issue