mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +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()
|
self.lock = asyncio.Lock()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def archive_image( starboard_message: discord.Message):
|
async def archive_image(starboard_message: discord.Message):
|
||||||
async with httpx.AsyncClient(
|
async with httpx.AsyncClient(
|
||||||
headers={
|
headers={
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.69; Win64; x64) "
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.69; Win64; x64) "
|
||||||
|
@ -145,7 +145,9 @@ class StarBoardCog(commands.Cog):
|
||||||
if star_count >= cap:
|
if star_count >= cap:
|
||||||
channel = discord.utils.get(message.guild.text_channels, name="starboard")
|
channel = discord.utils.get(message.guild.text_channels, name="starboard")
|
||||||
if channel and channel.can_send():
|
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)
|
await entry.update(starboard_message=msg.id)
|
||||||
self.bot.loop.create_task(self.archive_image(msg))
|
self.bot.loop.create_task(self.archive_image(msg))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue