feat: add user profile pictures and links

This commit is contained in:
Goldy 2024-08-15 17:45:42 +01:00
parent 1fe28d710e
commit e1e274f14b
1 changed files with 14 additions and 1 deletions

View File

@ -14,7 +14,20 @@ async def get_posts(inter: disnake.CommandInteraction):
embed_list = []
for post in r:
user = await soteria.User.fetch(sot, post["author"])
embed_list.append(disnake.Embed(title=f"Author: {user.display_name if user.display_name else user.username}", description=post["content"], color=disnake.Color.blue()))
embed = disnake.Embed(
description=post["content"],
color=disnake.Color.blue()
)
embed.set_author(
name=user.display_name if user.display_name else user.username,
url=f"https://soteria.social/{user.id}",
icon_url=soteria.Asset(sot, user.avatar).url
)
embed_list.append(embed)
await inter.edit_original_response(embeds=embed_list)
await sot.close()