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/fortune.py
Luke Rogers bf9468a4aa Merge branch 'develop' into refresh
Conflicts:
	disabled_stuff/mygengo_translate.py
	plugins/attacks.py
	plugins/core_sieve.py
	plugins/fortune.py
	plugins/geoip.py
	plugins/mark.py
2014-02-14 16:41:51 +13:00

15 lines
313 B
Python

import random
from util import hook
with open("./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)