@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) reactions = ["⭐", ":questionable_star:", ":star_struck:", ":star2:", ":StarPiece:", ":purple_star:"] count = 0 for star in 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: count += 1 embed = discord.Embed(title = "Starred message", 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) embed.set_footer(text = f"Stars: {len(stared_message.reactions.count)}") if len(stared_message.attachments): embed.set_image(url = stared_message.attachments[0].url) #if stars[1] >= count: #embed.set_footer(text = f"Stars: {stars[1]}") #else: #embed.set_footer(text = f"Stars: {count}") star_message = await starboard.send(embed = embed) if len(stared_message.reactions.count) == stars[1]: pass else: async with self.bot.pool.acquire() as conn: await conn.execute("UPDATE starboard SET stars=$1 WHERE id=$2", stared_message.reactions.count, payload.message_id) await star_message.edit(embed = embed) async with self.bot.pool.acquire() as conn: await conn.execute("UPDATE starboard SET post=$1 WHERE id=$2", star_message.id, payload.message_id) #if star in starred_message.reactions: #async with self.bot.pool.acquire() as conn: #await conn.execute("UPDATE starboard SET stars=$1 WHERE id=$2", count, payload.message_id) #await conn.execute("UPDATE starboard SET post=$1 WHERE id=$2", star_message.id, payload.message_id) #else: #star_message = await starboard.fetch_message(msg_id) #await star_message.edit(embed = embed) #async with self.bot.pool.acquire() as conn: #await conn.execute("UPDATE starboard SET stars=$1 WHERE id=$2", count, payload.message_id) else: await stared_message.remove_reaction(payload.emoji, payload.member)