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

18 lines
361 B
Python
Raw Normal View History

2011-11-20 10:23:31 +01:00
from util import hook
import re
import random
2012-03-26 06:17:19 +02:00
fortunes = []
with open("plugins/data/fortunes.txt") as f:
for line in f.readlines():
if line.startswith("//"):
continue
2012-03-26 07:33:11 +02:00
fortunes.append(line.strip())
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):
2012-02-28 03:03:43 +01:00
".fortune -- Fortune cookies on demand."
2012-03-26 10:59:02 +02:00
return random.choice(fortunes)