From c77c429ddfd6c149c65c018f4ff260881b147d4b Mon Sep 17 00:00:00 2001 From: Tyler Hawkins <3319104+tyzbit@users.noreply.github.com> Date: Sun, 6 Feb 2022 10:05:17 -0500 Subject: [PATCH] reply to stimulus messages --- bot.py | 10 +++++----- requirements.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bot.py b/bot.py index c386e8b..63ce6d3 100644 --- a/bot.py +++ b/bot.py @@ -83,7 +83,7 @@ async def send_dm(user=None, text=None, embed=None): else: logger.error(f'send_dm called without text or embed', extra={'guild': 'internal'}) -async def send_to_channel(channel=None, text=None, embed=None): +async def send_to_channel(channel=None, message=None, text=None, embed=None): ''' Sends a user a DM with the text string provided ''' @@ -92,9 +92,9 @@ async def send_to_channel(channel=None, text=None, embed=None): else: logger.debug(msg=f'Sending a message to the channel {channel.name}', extra={'guild': channel.guild}) if embed: - return await channel.send(embed=embed) + return await channel.send(embed=embed, reference=message, mention_author=False) elif text: - return await channel.send(text) + return await channel.send(text, reference=message, mention_author=False) else: logger.error(f'send_to_channel called without text or embed', extra={'guild': 'internal'}) @@ -112,9 +112,9 @@ async def respond_to_user(message=None, user=None, text=None, embed=None, repeat else: if message.id not in bot_state.handled_messages or repeat_react == True: if embed is not None: - await send_to_channel(message.channel, embed) + await send_to_channel(message.channel, message, embed) else: - await send_to_channel(message.channel, text) + await send_to_channel(message.channel, message, text) bot_state.handled_messages.append(message.id) else: logger.info(f'Message with ID {message.id} has already been responded to and repeat react not used', extra={'guild': message.guild.id}) diff --git a/requirements.txt b/requirements.txt index 6d31f4b..c01aee8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -discord.py == 1.4.1 +discord.py == 1.7.3 python-dotenv == 0.19.2 urlextract == 1.3.0 requests == 2.25.1 \ No newline at end of file