Upload URLs instead of attachments (testing needed)
This commit is contained in:
parent
99282874bb
commit
be96014447
1 changed files with 3 additions and 13 deletions
|
@ -60,10 +60,11 @@ class ModlogMessageCog(commands.Cog):
|
|||
]
|
||||
|
||||
if message.attachments:
|
||||
value = "\n".join([x.url for x in message.attachments])
|
||||
fields.append(
|
||||
Field(
|
||||
name="Attachments",
|
||||
value=f"{len(message.attachments)}",
|
||||
value=value,
|
||||
inline=False,
|
||||
)
|
||||
)
|
||||
|
@ -76,12 +77,6 @@ class ModlogMessageCog(commands.Cog):
|
|||
color="#fc9e3f",
|
||||
)
|
||||
|
||||
add_file = False
|
||||
if message.attachments:
|
||||
if "image" in message.attachments[0].content_type:
|
||||
embed.set_image(url=message.attachments[0].url)
|
||||
else:
|
||||
add_file = True
|
||||
embed.set_author(
|
||||
name=message.author.name,
|
||||
icon_url=message.author.avatar_url,
|
||||
|
@ -91,9 +86,4 @@ class ModlogMessageCog(commands.Cog):
|
|||
text=f"{message.author.name}#{message.author.discriminator}"
|
||||
+ f" | {message.author.id}"
|
||||
)
|
||||
if not add_file:
|
||||
await channel.send(embed=embed)
|
||||
else:
|
||||
await channel.send(
|
||||
embed=embed, file=(await message.attachments[0].to_file())
|
||||
)
|
||||
await channel.send(embed=embed)
|
||||
|
|
Loading…
Add table
Reference in a new issue