mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Added zen command.
This commit is contained in:
parent
442392b5ba
commit
36ecc4fcf6
@ -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)
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user