From 3aa3c6cefee02bf4bc10ab4c00504d9391242cb4 Mon Sep 17 00:00:00 2001 From: Dustin Rouillard Date: Fri, 20 Sep 2024 21:52:07 -0600 Subject: [PATCH] fix: String avatar decoration skus --- lib/presence/presence.ex | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/presence/presence.ex b/lib/presence/presence.ex index 0ab6c0c..c2ee36e 100644 --- a/lib/presence/presence.ex +++ b/lib/presence/presence.ex @@ -180,12 +180,15 @@ defmodule Lanyard.Presence do has_presence? = raw_data.discord_presence !== nil discord_user = - with %{clan: %{identity_guild_id: guild_id} = clan} <- raw_data.discord_user do - updated_clan = Map.put(clan, :identity_guild_id, "#{guild_id}") - Map.put(raw_data.discord_user, :clan, updated_clan) - else - _ -> raw_data.discord_user - end + raw_data.discord_user + |> Map.update(:clan, nil, fn + nil -> nil + clan -> Map.update(clan, :identity_guild_id, nil, fn guild_id -> "#{guild_id}" end) + end) + |> Map.update(:avatar_decoration_data, nil, fn + nil -> nil + avatar_data -> Map.update(avatar_data, :sku_id, nil, fn sku_id -> "#{sku_id}" end) + end) pretty_fields = if has_presence? do