Skip to content

Commit

Permalink
moved the privmsg to the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Delmolino committed Mar 4, 2010
1 parent e0bb18c commit 8e5790e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pyscripts/IrcBot/ircbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def left(self, channel):
def broadcast(self, message):
for channel in self.joined_channels:
self.say(channel, message)
def privmsg(self, user, channel, msg):
if channel == ircchannel:
user = user.split('!', 1)[0]
message(irc_msg_temp.substitute(colordict, channel=channel, name=user, message=msg))

class IrcBotFactory(protocol.ClientFactory):
protocol = IrcBot
Expand Down Expand Up @@ -73,11 +77,7 @@ def signedOut(self, bot):
def broadcast(self, message):
for bot in self.bots:
bot.broadcast(message)
def privmsg(self, user, channel, msg):
if channel == ircchannel:
user = user.split('!', 1)[0]
message(irc_msg_temp.substitute(colordict, channel=channel, name=user, message=msg))


event_abilities = {
'player_active': ('player_connect', lambda x: factory.broadcast('%s (\x037 %i \x03) \x032Connected\x03' % (sbserver.playerName(x), x))),
'player_disconnect': ('player_disconnect', lambda x: factory.broadcast('%s (\x037 %i \x03) \x032Disconnected\x03' % (sbserver.playerName(x), x))),
Expand Down

0 comments on commit 8e5790e

Please sign in to comment.