Added zen command.

This commit is contained in:
Jeremy Fincher 2003-08-30 19:23:34 +00:00
parent 442392b5ba
commit 36ecc4fcf6
2 changed files with 13 additions and 0 deletions

View File

@ -44,6 +44,7 @@ import sys
import new
import md5
import sha
import this
import time
import math
import cmath
@ -757,6 +758,15 @@ class FunCommands(callbacks.Privmsg):
"""
irc.reply(msg, random.sample(self._eightballs, 1)[0])
_these = [str(s) for s in this.s.decode('rot13').splitlines() if s]
def zen(self, irc, msg, args):
"""takes no arguments.
Returns one of the zen of Python statements.
"""
irc.reply(msg, random.sample(self._these, 1)[0])
def dns(self, irc, msg, args):
"""<host|ip>"""
host = privmsgs.getArgs(args)

View File

@ -91,6 +91,9 @@ class FunCommandsTest(PluginTestCase):
m = self.getMsg('tell #foo [rot13 foobar]')
self.failUnless(m.args[0] == '#foo')
self.failUnless('sbbone' in m.args[1])
def testZen(self):
self.assertNotError('zen')
def testDns(self):
self.assertNotError('dns slashdot.org')