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.
2011-11-20 10:23:31 +01:00
|
|
|
import random
|
|
|
|
|
2014-02-14 04:36:57 +01:00
|
|
|
from util import hook
|
|
|
|
|
|
|
|
|
2012-03-26 06:17:19 +02:00
|
|
|
with open("plugins/data/fortunes.txt") as f:
|
2012-05-16 21:41:41 +02:00
|
|
|
fortunes = [line.strip() for line in f.readlines()
|
|
|
|
if not line.startswith("//")]
|
2011-11-20 10:23:31 +01:00
|
|
|
|
2012-03-26 07:36:40 +02:00
|
|
|
|
2012-04-19 22:56:06 +02:00
|
|
|
@hook.command(autohelp=False)
|
2012-03-26 10:59:02 +02:00
|
|
|
def fortune(inp):
|
2013-09-04 12:30:04 +02:00
|
|
|
"""fortune -- Fortune cookies on demand."""
|
2012-03-26 10:59:02 +02:00
|
|
|
return random.choice(fortunes)
|