Fix bug involving attachments

This commit is contained in:
2025-11-22 09:23:52 -07:00
parent a375a194e0
commit 2ba4547f23

View File

@@ -57,6 +57,7 @@ async def on_reaction_add(react: discord.Reaction, user: discord.User):
message: discord.Message = react.message
reaction: discord.Reaction = react.emoji
link: str = react.message.jump_url
if len(react.message.attachments) > 0:
image: str = react.message.attachments[0].url
react_uid: int = react.emoji.id
@@ -83,6 +84,7 @@ async def on_reaction_add(react: discord.Reaction, user: discord.User):
timestamp=datetime.datetime.now())
embed.set_author(name=f"{react.message.author}")
if len(react.message.attachments) > 0:
embed.set_image(url=image)
posting_channel: discord.TextChannel = await client.fetch_channel(args.channel_id)