diff --git a/src/bot_core.py b/src/bot_core.py index 2ef8e7e..d9f2250 100644 --- a/src/bot_core.py +++ b/src/bot_core.py @@ -57,7 +57,8 @@ 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 - image: str = react.message.attachments[0].url + if len(react.message.attachments) > 0: + image: str = react.message.attachments[0].url react_uid: int = react.emoji.id message_uid: int = message.id @@ -83,7 +84,8 @@ async def on_reaction_add(react: discord.Reaction, user: discord.User): timestamp=datetime.datetime.now()) embed.set_author(name=f"{react.message.author}") - embed.set_image(url=image) + if len(react.message.attachments) > 0: + embed.set_image(url=image) posting_channel: discord.TextChannel = await client.fetch_channel(args.channel_id)