mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-17 17:37:22 +02:00
Added tell command.
This commit is contained in:
parent
9550971042
commit
bb1bdd2725
@ -701,6 +701,17 @@ class FunCommands(callbacks.Privmsg):
|
|||||||
return
|
return
|
||||||
irc.reply(msg, s)
|
irc.reply(msg, s)
|
||||||
|
|
||||||
|
def tell(self, irc, msg, args):
|
||||||
|
"""<nick|channel> <text>
|
||||||
|
|
||||||
|
Tells the <nick|channel> whatever <text> is. Use nested commands to
|
||||||
|
your benefit here.
|
||||||
|
"""
|
||||||
|
(target, text) = privmsgs.getArgs(args, needed=2)
|
||||||
|
s = '%s wants me to tell you: %s' % (msg.nick, text)
|
||||||
|
irc.queueMsg(ircmsgs.privmsg(target, s))
|
||||||
|
raise callbacks.CannotNest
|
||||||
|
|
||||||
def dns(self, irc, msg, args):
|
def dns(self, irc, msg, args):
|
||||||
"""<host|ip>"""
|
"""<host|ip>"""
|
||||||
host = privmsgs.getArgs(args)
|
host = privmsgs.getArgs(args)
|
||||||
|
@ -84,6 +84,14 @@ class FunCommandsTest(PluginTestCase):
|
|||||||
i = ord(c)
|
i = ord(c)
|
||||||
self.assertResponse('ord %s' % utils.dqrepr(c), str(i))
|
self.assertResponse('ord %s' % utils.dqrepr(c), str(i))
|
||||||
|
|
||||||
|
def testTell(self):
|
||||||
|
m = self.getMsg('tell foo [rot13 foobar]')
|
||||||
|
self.failUnless(m.args[0] == 'foo')
|
||||||
|
self.failUnless('sbbone' in m.args[1])
|
||||||
|
m = self.getMsg('tell #foo [rot13 foobar]')
|
||||||
|
self.failUnless(m.args[0] == '#foo')
|
||||||
|
self.failUnless('sbbone' in m.args[1])
|
||||||
|
|
||||||
def testDns(self):
|
def testDns(self):
|
||||||
self.assertNotError('dns slashdot.org')
|
self.assertNotError('dns slashdot.org')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user