mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
reFix starboard not attaching images properly
This commit is contained in:
parent
c0b1155b30
commit
29c8ecb19f
1 changed files with 9 additions and 11 deletions
|
@ -55,8 +55,6 @@ class StarBoardCog(commands.Cog):
|
|||
star_count = 0
|
||||
else:
|
||||
star_count = star_count[0].count
|
||||
# noinspection PyUnresolvedReferences
|
||||
cap = (message.channel if "thread" in message.channel.type.name else message.guild).member_count * 0.1
|
||||
embed = discord.Embed(colour=discord.Colour.gold(), timestamp=message.created_at, description=message.content)
|
||||
embed.set_author(
|
||||
name=message.author.display_name, url=message.jump_url, icon_url=message.author.display_avatar.url
|
||||
|
@ -99,14 +97,14 @@ class StarBoardCog(commands.Cog):
|
|||
else:
|
||||
embed.fields[1].value += textwrap.shorten(ref.content, 1024 - len(field.value), placeholder="...")
|
||||
|
||||
if message.attachments:
|
||||
for file in message.attachments:
|
||||
name = f"Attachment #{message.attachments.index(file)}"
|
||||
spoiler = file.is_spoiler()
|
||||
if spoiler:
|
||||
embed.add_field(name=name, value=f"||[{file.filename}]({file.url})||", inline=False)
|
||||
else:
|
||||
if file.content_type.startswith("image") and embed.image is discord.Embed.Empty:
|
||||
if file.content_type.startswith("image"):
|
||||
if embed.image.url is discord.Embed.Empty:
|
||||
embed.set_image(url=file.url)
|
||||
embed.add_field(name=name, value=f"[{file.filename}]({file.url})", inline=False)
|
||||
|
||||
|
|
Loading…
Reference in a new issue