From bb1bdd272502b374748dd2deac07c0102959e408 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 27 Aug 2003 07:46:03 +0000 Subject: [PATCH] Added tell command. --- plugins/FunCommands.py | 11 +++++++++++ test/test_FunCommands.py | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/plugins/FunCommands.py b/plugins/FunCommands.py index 3b60564bf..b548f0143 100644 --- a/plugins/FunCommands.py +++ b/plugins/FunCommands.py @@ -701,6 +701,17 @@ class FunCommands(callbacks.Privmsg): return irc.reply(msg, s) + def tell(self, irc, msg, args): + """ + + Tells the whatever 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 = privmsgs.getArgs(args) diff --git a/test/test_FunCommands.py b/test/test_FunCommands.py index 763ee7b50..4c7bde80b 100644 --- a/test/test_FunCommands.py +++ b/test/test_FunCommands.py @@ -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')