Merge pull request 'feat: add user profile pictures and links to `/get_posts`' (#1) from goldy/sox:main into main

Reviewed-on: https://codeberg.org/soteria/sox/pulls/1
This commit is contained in:
rainy 2024-08-16 20:27:18 +00:00
commit fc74e55111
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()