Lets try this again

This commit is contained in:
defnotken
2025-11-11 10:44:57 -06:00
parent 47fec97e81
commit a63742df83

View File

@@ -54,13 +54,15 @@ public class LightlessModule : InteractionModuleBase
if(eb.Fields.Any(f => string.Equals(f.Name, "Profile Description", StringComparison.Ordinal))) if(eb.Fields.Any(f => string.Equals(f.Name, "Profile Description", StringComparison.Ordinal)))
{ {
string uidToGet = await GetUserUID(db, secondaryUid, discordUser?.Id ?? null, uid).ConfigureAwait(false); string uidToGet = await GetUserUID(db, secondaryUid, discordUser?.Id ?? null, uid).ConfigureAwait(false);
_logger.LogInformation("Fetching profile image for UID: {uid}", uidToGet);
byte[] profileImage = await GetProfileImage(db, uid).ConfigureAwait(false); byte[] profileImage = await GetProfileImage(db, uid).ConfigureAwait(false);
using (MemoryStream ms = new(profileImage)) MemoryStream ms = new(profileImage);
await using (ms.ConfigureAwait(false))
{ {
eb.WithImageUrl("attachment://profileimage.png"); eb.WithImageUrl("attachment://profileimage.png");
await RespondWithFileAsync( await RespondWithFileAsync(
ms, fileStream: ms,
"profileimage.png", fileName: "profileimage.png",
embeds: new[] { eb.Build() }, embeds: new[] { eb.Build() },
ephemeral: true).ConfigureAwait(false); ephemeral: true).ConfigureAwait(false);
} }