Created
May 29, 2015 04:37
-
-
Save cat5inthecradle/4418ea4bde3890c5677b to your computer and use it in GitHub Desktop.
Jabberbot BOFH Excuse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # download the bofh excuse list from http://pages.cs.wisc.edu/~ballard/bofh/excuses | |
| # save the list to ./bofh/bofh.txt with each excuse on a new line | |
| @botcmd | |
| def why(self, mess, arg): | |
| try: | |
| excuses = open('bofh/bofh.txt') | |
| self.send_simple_reply(mess, random.choice(excuses.readlines()).rstrip('\r\n')) | |
| except Exception, e: | |
| self.send_simple_reply(mess, "Sorry I can't think of a good excuse, or bofh/bofh.txt is missing.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment