add chuck norris command

This commit is contained in:
Gordon Shumway 2019-11-11 03:23:03 -05:00 committed by GitHub
parent fc8b4bff13
commit 64e4df0808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,4 +260,15 @@ class Fun(callbacks.Plugin):
irc.reply(reply[excuse])
mitch = wrap(mitch)
def chuck(self, irc, msg, args):
"""
Mitch (Hedberg) Jokes
"""
data = open("{0}/chuck_norris.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])
mitch = wrap(mitch)
Class = Fun