mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Starboard
This commit is contained in:
parent
0f258f860e
commit
c16dd64970
1 changed files with 4 additions and 2 deletions
|
@ -17,7 +17,7 @@ class StarBoardCog(commands.Cog):
|
|||
self.lock = asyncio.Lock()
|
||||
|
||||
@staticmethod
|
||||
async def archive_image( starboard_message: discord.Message):
|
||||
async def archive_image(starboard_message: discord.Message):
|
||||
async with httpx.AsyncClient(
|
||||
headers={
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.69; Win64; x64) "
|
||||
|
@ -145,7 +145,9 @@ class StarBoardCog(commands.Cog):
|
|||
if star_count >= cap:
|
||||
channel = discord.utils.get(message.guild.text_channels, name="starboard")
|
||||
if channel and channel.can_send():
|
||||
msg = await channel.send(embed=await self.generate_starboard_embed(message))
|
||||
embed = await self.generate_starboard_embed(message)
|
||||
embeds = [embed, *tuple(filter(lambda x: x.type == "rich", message.embeds))][:10]
|
||||
msg = await channel.send(embeds=embeds)
|
||||
await entry.update(starboard_message=msg.id)
|
||||
self.bot.loop.create_task(self.archive_image(msg))
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue