Skip to content

Commit

Permalink
Clean up the clan identity update
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinrouillard committed Sep 18, 2024
1 parent d5c382d commit ae74f78
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lib/presence/presence.ex
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,11 @@ defmodule Lanyard.Presence do
has_presence? = raw_data.discord_presence !== nil

discord_user =
if raw_data.discord_user.clan != nil do
user_clan =
Map.put(
raw_data.discord_user.clan,
:identity_guild_id,
"#{raw_data.discord_user.clan.identity_guild_id}"
)

Map.put(
raw_data.discord_user,
:clan,
user_clan
)
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
_ -> raw_data.discord_user
end

pretty_fields =
Expand Down

0 comments on commit ae74f78

Please sign in to comment.