Adjusted text variable names through IRCbot message life cycle to match new practice.
This commit is contained in:
parent
6cea12de42
commit
9503b30a5e
3 changed files with 7 additions and 7 deletions
|
|
@ -874,7 +874,7 @@ class CmdIRC2Chan(COMMAND_DEFAULT_CLASS):
|
||||||
self.rhs = self.rhs.replace('#', ' ') # to avoid Python comment issues
|
self.rhs = self.rhs.replace('#', ' ') # to avoid Python comment issues
|
||||||
try:
|
try:
|
||||||
irc_network, irc_port, irc_channel, irc_botname = \
|
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
|
irc_channel = "#%s" % irc_channel
|
||||||
except Exception:
|
except Exception:
|
||||||
string = "IRC bot definition '%s' is not valid." % self.rhs
|
string = "IRC bot definition '%s' is not valid." % self.rhs
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ class IRCBot(Bot):
|
||||||
if not from_obj or from_obj != [self.id]:
|
if not from_obj or from_obj != [self.id]:
|
||||||
super(IRCBot, self).msg(text=text, options={"bot_data_out": True})
|
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
|
Take incoming data and send it to connected channel. This is
|
||||||
triggered by the bot_data_in Inputfunc.
|
triggered by the bot_data_in Inputfunc.
|
||||||
|
|
@ -233,9 +233,9 @@ class IRCBot(Bot):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if kwargs["type"] == "action":
|
if kwargs["type"] == "action":
|
||||||
text = "%s@%s %s" % (kwargs["user"], kwargs["channel"], text)
|
text = "%s@%s %s" % (kwargs["user"], kwargs["channel"], txt)
|
||||||
else:
|
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:
|
if not self.ndb.ev_channel and self.db.ev_channel:
|
||||||
# cache channel lookup
|
# cache channel lookup
|
||||||
|
|
@ -286,7 +286,7 @@ class RSSBot(Bot):
|
||||||
"rate": self.db.rss_rate}
|
"rate": self.db.rss_rate}
|
||||||
_SESSIONS.start_bot_session("evennia.server.portal.rss.RSSBotFactory", configdict)
|
_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
|
Take incoming data and send it to connected channel. This is
|
||||||
triggered by the bot_data_in Inputfunc.
|
triggered by the bot_data_in Inputfunc.
|
||||||
|
|
@ -303,4 +303,4 @@ class RSSBot(Bot):
|
||||||
# cache channel lookup
|
# cache channel lookup
|
||||||
self.ndb.ev_channel = self.db.ev_channel
|
self.ndb.ev_channel = self.db.ev_channel
|
||||||
if self.ndb.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)
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ def bot_data_in(session, *args, **kwargs):
|
||||||
return
|
return
|
||||||
kwargs.pop("options", None)
|
kwargs.pop("options", None)
|
||||||
# Trigger the execute_cmd method of the corresponding bot.
|
# 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()
|
session.update_session_counters()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue