mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +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
|
return
|
||||||
else:
|
else:
|
||||||
channel = discord.utils.get(message.guild.text_channels, name="starboard")
|
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:
|
if channel and channel.can_send() and entry.starboard_message:
|
||||||
try:
|
try:
|
||||||
msg = await channel.fetch_message(entry.starboard_message)
|
msg = await channel.fetch_message(entry.starboard_message)
|
||||||
except discord.NotFound:
|
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)
|
await entry.update(starboard_message=msg.id)
|
||||||
except discord.HTTPException:
|
except discord.HTTPException:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
await msg.edit(embed=await self.generate_starboard_embed(message))
|
await msg.edit(embeds=embeds)
|
||||||
|
|
||||||
@commands.message_command(name="Starboard Info")
|
@commands.message_command(name="Starboard Info")
|
||||||
@discord.guild_only()
|
@discord.guild_only()
|
||||||
|
|
Loading…
Reference in a new issue