diff --git a/worker/lib/guild/verify/message.ex b/worker/lib/guild/verify/message.ex index 6be280fc..11c4b562 100644 --- a/worker/lib/guild/verify/message.ex +++ b/worker/lib/guild/verify/message.ex @@ -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