Merge pull request #3005 from InspectorCaracal/discord-patch

Fix Discord issue involving keyword mismatch
This commit is contained in:
Griatch 2022-12-01 09:09:37 +01:00 committed by GitHub
commit bf339afd1f

View file

@ -648,7 +648,7 @@ class DiscordBot(Bot):
relayed (bool) - A flag identifying whether the message was relayed by the bot. relayed (bool) - A flag identifying whether the message was relayed by the bot.
""" """
if kwargs.get("relayed"): if relayed:
# don't relay our own relayed messages # don't relay our own relayed messages
return return
if channel_list := self.db.channels: if channel_list := self.db.channels:
@ -712,7 +712,7 @@ class DiscordBot(Bot):
def execute_cmd( def execute_cmd(
self, self,
content=None, txt=None,
session=None, session=None,
type=None, type=None,
sender=None, sender=None,
@ -723,7 +723,7 @@ class DiscordBot(Bot):
triggered by the bot_data_in Inputfunc. triggered by the bot_data_in Inputfunc.
Keyword args: Keyword args:
content (str) - The content of the message from Discord. txt (str) - The content of the message from Discord.
session (Session) - The protocol session this command came from. session (Session) - The protocol session this command came from.
type (str, optional) - Indicates the type of activity from Discord, if type (str, optional) - Indicates the type of activity from Discord, if
the protocol pre-processed it. the protocol pre-processed it.
@ -749,12 +749,12 @@ class DiscordBot(Bot):
if not channel: if not channel:
continue continue
channel = channel[0] channel = channel[0]
self.relay_to_channel(content, channel, sender, channel_name, guild) self.relay_to_channel(txt, channel, sender, channel_name, guild)
# direct message # direct message
elif type == "direct": elif type == "direct":
# pass on to the DM hook # pass on to the DM hook
self.direct_msg(content, sender, **kwargs) self.direct_msg(txt, sender, **kwargs)
# guild info update # guild info update
elif type == "guild": elif type == "guild":