From 640ecff99d3e852f4d3d0e853daa714b5e4cc5c0 Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Sat, 11 Dec 2010 17:12:05 -0600 Subject: Messages in a channel directed to the bot send a h a help message --- logbot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logbot.py b/logbot.py index fdfdd55..885c002 100644 --- a/logbot.py +++ b/logbot.py @@ -55,6 +55,8 @@ CHANNELS=["#excid3"] NICK = "timber" NICK_PASS = "" +HELP_MESSAGE = "Check out http://excid3.com" + FTP_SERVER = "excid3.fivebean.net" FTP_USER = "excidfiv" FTP_PASS = "./:j7JW}y*;.a4'8/|kBA.tUC" @@ -63,8 +65,8 @@ FTP_WAIT = 25 # Only upload every 25 messages default_format = { + "help" : HELP_MESSAGE, "action" : '* %user% %message%', - "help" : 'Check out http://excid3.com', "join" : '-!- %user% [%host%] has joined %channel%', "kick" : '-!- %user% was kicked from %channel% by %kicker% [%reason%]', "mode" : '-!- mode/%channel% [%modes% %person%] by %giver%', @@ -288,6 +290,8 @@ class Logbot(SingleServerIRCBot): self.write_event("part", e) def on_pubmsg(self, c, e): + if e.arguments()[0].startswith(NICK): + c.privmsg(e.target(), self.format["help"]) self.write_event("pubmsg", e) def on_pubnotice(self, c, e): -- cgit v1.2.3