mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added tell command.
This commit is contained in:
parent
9550971042
commit
bb1bdd2725
@ -701,6 +701,17 @@ class FunCommands(callbacks.Privmsg):
|
||||
return
|
||||
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):
|
||||
"""<host|ip>"""
|
||||
host = privmsgs.getArgs(args)
|
||||
|
@ -84,6 +84,14 @@ class FunCommandsTest(PluginTestCase):
|
||||
i = ord(c)
|
||||
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):
|
||||
self.assertNotError('dns slashdot.org')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user