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 * Added Note.unsend command, to allow users to "unsend" notes
they've sent but whose recipient has not yet read. they've sent but whose recipient has not yet read.

View File

@ -116,6 +116,12 @@ class Fun(callbacks.Privmsg):
text = ''.join(text.split()) text = ''.join(text.split())
irc.reply(msg, text) 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): def hexip(self, irc, msg, args):
"""<ip> """<ip>

View File

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