add developer and bofh excuse generators

This commit is contained in:
Gordon Shumway 2019-02-28 19:33:20 -05:00 committed by GitHub
parent aa4e51ae37
commit 3b079a3c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -15,6 +15,8 @@ import requests
import html
import arrr
from bs4 import BeautifulSoup
import os
import random
try:
from supybot.i18n import PluginInternationalization
@ -213,4 +215,15 @@ class Fun(callbacks.Plugin):
irc.reply(" ".join(l))
piglatin = wrap(piglatin, [('text')])
def bofh(self, irc, msg, args):
"""
BOFH Excuse Generator
"""
data = open("{0}/excuses.txt".format(os.path.dirname(os.path.abspath(__file__))))
text = data.read()
reply = text.splitlines()
excuse = random.randrange(0, len(reply))
irc.reply(reply[excuse])
bofh = wrap(bofh)
Class = Fun