Added ping command.

This commit is contained in:
Jeremy Fincher 2003-12-03 23:56:06 +00:00
parent 3398f1a819
commit 4aa05c353a
3 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,5 @@
* Added the Fun.ping command, because MozBot has it.
* Added Note.unsend command, to allow users to "unsend" notes
they've sent but whose recipient has not yet read.

View File

@ -116,6 +116,12 @@ class Fun(callbacks.Privmsg):
text = ''.join(text.split())
irc.reply(msg, text)
def ping(self, irc, msg, args):
"""takes no arguments
Checks to see if the bot is alive.
"""
irc.reply(msg, 'pong', prefixName=False)
def hexip(self, irc, msg, args):
"""<ip>

View File

@ -49,6 +49,9 @@ class FunTest(ChannelPluginTestCase, PluginDocumentation):
else:
self.fail('Got something other than a kick or a privmsg.')
self.failUnless(sawKick, 'Didn\'t get a kick in %s iterations!' % i)
def testPing(self):
self.assertResponse('ping', 'pong')
def testNoErrors(self):
self.assertNotError('leet foobar')