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/fortune.py
2012-09-05 07:52:03 +12:00

13 lines
312 B
Python
Executable file

from util import hook
import random
with open("plugins/data/fortunes.txt") as f:
fortunes = [line.strip() for line in f.readlines()
if not line.startswith("//")]
@hook.command(autohelp=False)
def fortune(inp):
"fortune -- Fortune cookies on demand."
return random.choice(fortunes)