From 41859d9e46c902be79ace6e3e547f52318a91603 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 30 Jan 2013 15:14:30 +0100 Subject: [PATCH] Added the ability for the IRC bot to parse /me emotes from the IRC channel. --- src/comms/irc.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/comms/irc.py b/src/comms/irc.py index 2d0ffe293..dea4a60ae 100644 --- a/src/comms/irc.py +++ b/src/comms/irc.py @@ -52,6 +52,7 @@ class IRC_Bot(irc.IRCClient): msg_info(msg) logger.log_infomsg(msg) + def privmsg(self, user, irc_channel, msg): "Someone has written something in irc channel. Echo it to the evennia channel" #find irc->evennia channel mappings @@ -69,6 +70,23 @@ class IRC_Bot(irc.IRCClient): for conn in conns: if conn.channel: conn.to_channel(msg) + def action(self, user, irc_channel, msg): + "Someone has performed an action, e.g. using /me " + #find irc->evennia channel mappings + conns = ExternalChannelConnection.objects.filter(db_external_key=self.factory.key) + if not conns: + return + #format message: + user = user.split("!")[0] + if user: + user.strip() + else: + user = _("Unknown") + msg = "[%s] *%s@%s %s*" % (self.factory.evennia_channel, user, irc_channel, msg.strip()) + #logger.log_infomsg("