Skip to content

Commit

Permalink
[worker] Fix embed creation for successful verification
Browse files Browse the repository at this point in the history
Signed-off-by: tiksan <[email protected]>
  • Loading branch information
dssecret committed Oct 1, 2024
1 parent 77ac0f8 commit d0ad7af
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions worker/lib/guild/verify/message.ex
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,30 @@ defmodule Tornium.Guild.Verify.Message do
removed_roles = MapSet.difference(original_roles, updated_roles)
added_roles = MapSet.difference(updated_roles, original_roles)

if updated_member.nick != original_member.nick do
^embed = Nostrum.Struct.Embed.put_field(embed, "Nickname", "#{original_member.nick} -> #{updated_member.nick}")
end
embed =
if updated_member.nick != original_member.nick do
Nostrum.Struct.Embed.put_field(embed, "Nickname", "#{original_member.nick} -> #{updated_member.nick}")
else
embed
end

if MapSet.size(removed_roles) > 0 do
^embed =
embed =
if MapSet.size(removed_roles) > 0 do
Nostrum.Struct.Embed.put_field(
embed,
"Removed Roles",
Tornium.Utils.roles_to_string(MapSet.to_list(removed_roles))
)
end
else
embed
end

if MapSet.size(added_roles) > 0 do
^embed =
embed =
if MapSet.size(added_roles) > 0 do
Nostrum.Struct.Embed.put_field(embed, "Added Roles", Tornium.Utils.roles_to_string(MapSet.to_list(added_roles)))
end
else
embed
end

embed
end
Expand Down

0 comments on commit d0ad7af

Please sign in to comment.