@commands.Cog.listener() async def on_raw_reaction_add(self, payload): data = await self.bot.get_data(payload.guild_id) starboard = self.bot.get_channel(data[27]) stars = await self.bot.get_star(payload.guild_id) star_reactions = ["⭐", ":questionable_star:", ":star_struck:", ":star2:", ":StarPiece:", ":purple_star:"] for star in star_reactions: if payload.emoji.name == star: stared_message = await self.bot.get_channel(payload.channel_id).fetch_message(payload.message_id) if not stared_message.author.bot and payload.member.id != stared_message.author.id: embed = discord.Embed(title = f"[Starred message](stared_message.jump_url)", description = stared_message.content or "See attachment", colour = stared_message.author.colour, timestamp = datetime.datetime.utcnow()) embed.set_author(name = stared_message.author, icon_url = stared_message.author.avatar_url) if len(stared_message.attachments): embed.set_image(url = stared_message.attachments[0].url) #embed.set_footer(text = f"Stars: {stared_message.reactions.count()}" for reaction in stared_message.reactions: #if reaction in star_reactions: embed.set_footer(text = f"Stars: {str(reaction.count())}") star_message = await starboard.send(embed = embed) if stars[1] != reaction.count(): async with self.bot.pool.acquire() as conn: await conn.execute("UPDATE starboard SET stars=$1 WHERE id=$2", reaction.count(), payload.message_id) await conn.execute("UPDATE starboard SET post=$1 WHERE id=$2", star_message.id, payload.message_id) await star_message.edit(embed = embed) else: await stared_message.remove_reaction(payload.emoji, payload.member)