pyircbot/pyircbot/modules/PingResponder.py

20 lines
547 B
Python
Raw Normal View History

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>
"""
2013-12-28 09:58:20 -08:00
from modulebase import ModuleBase,ModuleHook
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)
self.log.info("Responded to a ping: %s" % trailing)