From 9503b30a5e7a5ad7a8faab0e8a4a9abf5c75ab1a Mon Sep 17 00:00:00 2001 From: Cloud_Keeper Date: Wed, 8 Feb 2017 13:33:31 +1100 Subject: [PATCH] Adjusted text variable names through IRCbot message life cycle to match new practice. --- evennia/commands/default/comms.py | 2 +- evennia/players/bots.py | 10 +++++----- evennia/server/inputfuncs.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/evennia/commands/default/comms.py b/evennia/commands/default/comms.py index dff9371502..7ad61fdfe7 100644 --- a/evennia/commands/default/comms.py +++ b/evennia/commands/default/comms.py @@ -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 diff --git a/evennia/players/bots.py b/evennia/players/bots.py index 2518568be7..c20e5199c7 100644 --- a/evennia/players/bots.py +++ b/evennia/players/bots.py @@ -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) diff --git a/evennia/server/inputfuncs.py b/evennia/server/inputfuncs.py index 722beab44d..17442ba6ec 100644 --- a/evennia/server/inputfuncs.py +++ b/evennia/server/inputfuncs.py @@ -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()