2013-12-28 09:58:20 -08:00
|
|
|
#!/usr/bin/env python
|
2014-10-02 18:14:42 -07:00
|
|
|
"""
|
|
|
|
.. module:: PingResponder
|
|
|
|
:synopsis: Module to repsond to irc server PING requests
|
|
|
|
|
|
|
|
.. moduleauthor:: Dave Pedu <dave@davepedu.com>
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2015-06-18 19:29:46 -07:00
|
|
|
from pyircbot.modulebase import ModuleBase,ModuleHook
|
2013-12-28 09:58:20 -08:00
|
|
|
|
|
|
|
class PingResponder(ModuleBase):
|
|
|
|
def __init__(self, bot, moduleName):
|
|
|
|
ModuleBase.__init__(self, bot, moduleName);
|
|
|
|
self.hooks=[ModuleHook("PING", self.pingrespond)]
|
|
|
|
def pingrespond(self, args, prefix, trailing):
|
|
|
|
# got a ping? send it right back
|
|
|
|
self.bot.act_PONG(trailing)
|
2015-06-16 23:36:23 -07:00
|
|
|
self.log.info("%s Responded to a ping: %s" % (self.bot.get_nick(), trailing))
|