Added specific logging of CTCP requests.

This commit is contained in:
Jeremy Fincher 2003-08-14 17:54:28 +00:00
parent 936c1fd85e
commit 330dfad1ea

View File

@ -42,6 +42,7 @@ import time
sys.path.append(os.pardir) sys.path.append(os.pardir)
import debug
import ircmsgs import ircmsgs
import callbacks import callbacks
@ -51,28 +52,34 @@ class Ctcp(callbacks.PrivmsgRegexp):
public = False public = False
def ping(self, irc, msg, match): def ping(self, irc, msg, match):
"\x01PING (.*)\x01" "\x01PING (.*)\x01"
debug.msg('Received CTCP PING from %s' % msg.nick, 'normal')
irc.queueMsg(notice(msg.nick, '\x01PING %s\x01' % match.group(1))) irc.queueMsg(notice(msg.nick, '\x01PING %s\x01' % match.group(1)))
def version(self, irc, msg, match): def version(self, irc, msg, match):
"\x01VERSION\x01" "\x01VERSION\x01"
debug.msg('Received CTCP VERSION from %s' % msg.nick, 'normal')
s = '\x01VERSION SupyBot %s\x01' % world.version s = '\x01VERSION SupyBot %s\x01' % world.version
irc.queueMsg(notice(msg.nick, s)) irc.queueMsg(notice(msg.nick, s))
def userinfo(self, irc, msg, match): def userinfo(self, irc, msg, match):
"\x01USERINFO\x01" "\x01USERINFO\x01"
debug.msg('Received CTCP USERINFO from %s' % msg.nick, 'normal')
irc.queueMsg(notice(msg.nick, '\x01USERINFO\x01')) irc.queueMsg(notice(msg.nick, '\x01USERINFO\x01'))
def time(self, irc, msg, match): def time(self, irc, msg, match):
"\x01TIME\x01" "\x01TIME\x01"
debug.msg('Received CTCP TIME from %s' % msg.nick, 'normal')
irc.queueMsg(notice(msg.nick, '\x01%s\x01' % time.ctime())) irc.queueMsg(notice(msg.nick, '\x01%s\x01' % time.ctime()))
def finger(self, irc, msg, match): def finger(self, irc, msg, match):
"\x01FINGER\x01" "\x01FINGER\x01"
debug.msg('Received CTCP FINGER from %s' % msg.nick, 'normal')
s = '\x01SupyBot, the best Python bot in existence!\x01' s = '\x01SupyBot, the best Python bot in existence!\x01'
irc.queueMsg(notice(msg.nick, s)) irc.queueMsg(notice(msg.nick, s))
def source(self, irc, msg, match): def source(self, irc, msg, match):
"\x01SOURCE\x01" "\x01SOURCE\x01"
debug.msg('Received CTCP SOURCE from %s' % msg.nick, 'normal')
s = 'http://www.sourceforge.net/projects/supybot/' s = 'http://www.sourceforge.net/projects/supybot/'
irc.queueMsg(notice(msg.nick, s)) irc.queueMsg(notice(msg.nick, s))