Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
reply to stimulus messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tyzbit committed Feb 6, 2022
1 parent 66ebebe commit c77c429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
Expand All @@ -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'})

Expand All @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c77c429

Please sign in to comment.