Adjusted text variable names through IRCbot message life cycle to match new practice.

This commit is contained in:
Cloud_Keeper 2017-02-08 13:33:31 +11:00 committed by Griatch
parent 6cea12de42
commit 9503b30a5e
3 changed files with 7 additions and 7 deletions

View file

@ -874,7 +874,7 @@ class CmdIRC2Chan(COMMAND_DEFAULT_CLASS):
self.rhs = self.rhs.replace('#', ' ') # to avoid Python comment issues
try:
irc_network, irc_port, irc_channel, irc_botname = \
[part.strip() for part in self.rhs.split(None, 3)]
[part.strip() for part in self.rhs.split()[:4]]
irc_channel = "#%s" % irc_channel
except Exception:
string = "IRC bot definition '%s' is not valid." % self.rhs

View file

@ -216,7 +216,7 @@ class IRCBot(Bot):
if not from_obj or from_obj != [self.id]:
super(IRCBot, self).msg(text=text, options={"bot_data_out": True})
def execute_cmd(self, session=None, text=None, **kwargs):
def execute_cmd(self, session=None, txt=None, **kwargs):
"""
Take incoming data and send it to connected channel. This is
triggered by the bot_data_in Inputfunc.
@ -233,9 +233,9 @@ class IRCBot(Bot):
"""
if kwargs["type"] == "action":
text = "%s@%s %s" % (kwargs["user"], kwargs["channel"], text)
text = "%s@%s %s" % (kwargs["user"], kwargs["channel"], txt)
else:
text = "%s@%s: %s" % (kwargs["user"], kwargs["channel"], text)
text = "%s@%s: %s" % (kwargs["user"], kwargs["channel"], txt)
if not self.ndb.ev_channel and self.db.ev_channel:
# cache channel lookup
@ -286,7 +286,7 @@ class RSSBot(Bot):
"rate": self.db.rss_rate}
_SESSIONS.start_bot_session("evennia.server.portal.rss.RSSBotFactory", configdict)
def execute_cmd(self, text=None, session=None, **kwargs):
def execute_cmd(self, txt=None, session=None, **kwargs):
"""
Take incoming data and send it to connected channel. This is
triggered by the bot_data_in Inputfunc.
@ -303,4 +303,4 @@ class RSSBot(Bot):
# cache channel lookup
self.ndb.ev_channel = self.db.ev_channel
if self.ndb.ev_channel:
self.ndb.ev_channel.msg(text, senders=self.id)
self.ndb.ev_channel.msg(txt, senders=self.id)

View file

@ -105,7 +105,7 @@ def bot_data_in(session, *args, **kwargs):
return
kwargs.pop("options", None)
# Trigger the execute_cmd method of the corresponding bot.
session.player.execute_cmd(session=session, text=txt, **kwargs)
session.player.execute_cmd(session=session, txt=txt, **kwargs)
session.update_session_counters()