mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Allow starring embeds
This commit is contained in:
parent
a2ccb56316
commit
cc1f8b67cc
1 changed files with 4 additions and 2 deletions
|
@ -117,16 +117,18 @@ class StarBoardCog(commands.Cog):
|
|||
return
|
||||
else:
|
||||
channel = discord.utils.get(message.guild.text_channels, name="starboard")
|
||||
embed = await self.generate_starboard_embed(message)
|
||||
embeds = [embed, *tuple(filter(lambda x: x.type == "rich", message.embeds))][:10]
|
||||
if channel and channel.can_send() and entry.starboard_message:
|
||||
try:
|
||||
msg = await channel.fetch_message(entry.starboard_message)
|
||||
except discord.NotFound:
|
||||
msg = await channel.send(embed=await self.generate_starboard_embed(message))
|
||||
msg = await channel.send(embeds=embeds)
|
||||
await entry.update(starboard_message=msg.id)
|
||||
except discord.HTTPException:
|
||||
pass
|
||||
else:
|
||||
await msg.edit(embed=await self.generate_starboard_embed(message))
|
||||
await msg.edit(embeds=embeds)
|
||||
|
||||
@commands.message_command(name="Starboard Info")
|
||||
@discord.guild_only()
|
||||
|
|
Loading…
Reference in a new issue