This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/plugins/choose.py

15 lines
268 B
Python
Raw Normal View History

2011-11-20 10:23:31 +01:00
import random
from util import hook
@hook.command
def choose(inp):
"""choose <choice1>, [choice2], [choice3]
2013-09-04 12:30:04 +02:00
Randomly picks one of the given choices."""
2011-11-20 10:23:31 +01:00
c = inp.split(" ")
2011-11-20 10:23:31 +01:00
if len(c) == 1:
return 'banana'
2011-11-20 10:23:31 +01:00
return random.choice(c).strip()