This repository has been archived on 2023-04-13. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
CloudBot/plugins/choose.py
2013-09-05 08:53:07 +08:00

14 lines
268 B
Python
Executable file

import random
from util import hook
@hook.command
def choose(inp):
"""choose <choice1>, [choice2], [choice3]
Randomly picks one of the given choices."""
c = inp.split(" ")
if len(c) == 1:
return 'banana'
return random.choice(c).strip()