Default behaviour now working.

This commit is contained in:
Cloud_Keeper 2017-01-25 20:55:49 +11:00 committed by Griatch
parent 40d4f6d286
commit d96509cb4e

View file

@ -219,16 +219,23 @@ class IRCBot(Bot):
def execute_cmd(self, session=None, text=None, **kwargs): def execute_cmd(self, session=None, text=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 CmdListen command in the BotCmdSet. triggered by the bot_data_in Inputfunc.
Args: Args:
session (Session, optional): Session responsible for this session (Session, optional): Session responsible for this
command. command.
text (str, optional): Command string. text (str, optional): Command string.
kwargs (dict, optional): Additional Information passed from bot.
Typically information is only passed by IRCbot including:
user (str): The name of the user who sent the message.
channel (str): The name of channel the message was sent to.
type (str): Nature of message. Either 'msg' or 'action'.
""" """
# Dev Test if kwargs["type"] == "action":
text += str(kwargs) # if kwargs else "" text = "%s@%s %s" % (kwargs["user"], kwargs["channel"], text)
else:
text = "%s@%s: %s" % (kwargs["user"], kwargs["channel"], text)
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
@ -281,7 +288,15 @@ class RSSBot(Bot):
def execute_cmd(self, text=None, session=None, **kwargs): def execute_cmd(self, text=None, session=None, **kwargs):
""" """
Echo RSS input to connected channel Take incoming data and send it to connected channel. This is
triggered by the bot_data_in Inputfunc.
Args:
session (Session, optional): Session responsible for this
command.
text (str, optional): Command string.
kwargs (dict, optional): Additional Information passed from bot.
Not used by the RSSbot by default.
""" """
if not self.ndb.ev_channel and self.db.ev_channel: if not self.ndb.ev_channel and self.db.ev_channel: