Remove bot (info) response.

This commit is contained in:
Merdal Kaymaz 2015-02-02 01:09:12 +01:00
parent 5331fbf209
commit 7a4c139da9
2 changed files with 3 additions and 11 deletions

View File

@ -7,8 +7,6 @@ channel=#a-bridged-channel
nick=RelayBot
#Can change to allow more specialized behavior.
mode=Default
#Response sent when addressed with <nickname>: or privmsg'd.
info=This is a relay bot.
username=RelayBot
realname=Relay P. Botterson
heartbeat=90

View File

@ -32,7 +32,7 @@ def main():
return None
options = {}
for option in [ "timeout", "host", "port", "nick", "channel", "info", "heartbeat", "password", "username", "realname" ]:
for option in [ "timeout", "host", "port", "nick", "channel", "heartbeat", "password", "username", "realname" ]:
options[option] = get(option)
mode = get("mode")
@ -90,7 +90,6 @@ class IRCRelayer(irc.IRCClient):
self.channel = config['channel']
self.nickname = config['nick']
self.identifier = config['identifier']
self.privMsgResponse = config['info']
self.heartbeatInterval = float(config['heartbeat'])
self.username = config['username']
self.realname = config['realname']
@ -122,16 +121,11 @@ class IRCRelayer(irc.IRCClient):
communicator.register(self)
def privmsg(self, user, channel, message):
#If someone addresses the bot directly, respond in the same way.
# If someone addresses the bot directly, don't respond.
if channel == self.nickname:
log.msg("Recieved privmsg from %s."%user)
self.msg(user, self.privMsgResponse)
log.msg("Recieved privmsg from %s: %s"%(user, message))
else:
self.relay("[%s] %s"%(self.formatUsername(user), message))
if message.startswith(self.nickname + ':'):
self.say(self.channel, self.privMsgResponse)
#For consistancy, if anyone responds to the bot's response:
self.relay("[%s] %s"%(self.formatUsername(self.nickname), self.privMsgResponse))
def kickedFrom(self, channel, kicker, message):
log.msg("Kicked by %s. Message \"%s\""%(kicker, message))