diff --git a/webapp/titanembeds/blueprints/gateway/gateway.py b/webapp/titanembeds/blueprints/gateway/gateway.py index f86ce58..9532d35 100644 --- a/webapp/titanembeds/blueprints/gateway/gateway.py +++ b/webapp/titanembeds/blueprints/gateway/gateway.py @@ -164,6 +164,7 @@ class Gateway(Namespace): usr["color"] = self.get_user_color(guild_id, usr["id"]) if (usr["avatar"]): usr["avatar_url"] = "https://cdn.discordapp.com/avatars/{}/{}.jpg".format(usr["id"], usr["avatar"]) + usr["roles"] = json.loads(member.roles) usr["stargazer"] = "star" in get_badges(member.user_id) else: member = db.session.query(GuildMembers).filter(GuildMembers.guild_id == guild_id, GuildMembers.nickname == name, GuildMembers.discriminator == discriminator).first() @@ -175,6 +176,7 @@ class Gateway(Namespace): usr["color"] = self.get_user_color(guild_id, usr["id"]) if (usr["avatar"]): usr["avatar_url"] = "https://cdn.discordapp.com/avatars/{}/{}.jpg".format(usr["id"], usr["avatar"]) + usr["roles"] = json.loads(member.roles) usr["stargazer"] = "star" in get_badges(member.user_id) emit("lookup_user_info", usr) self.teardown_db_session() \ No newline at end of file diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index a283eca..01fa04c 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -1200,9 +1200,10 @@ parent.find(".chatusername").addClass("stargazer"); } if (usr.avatar_url) { - parent.attr("discord_userid", usr.id); parent.find(".authoravatar").prop("src", usr.avatar_url); } + parent.attr("discord_userid", usr.id); + parent.attr("discord_userroles", usr.roles.join(" ")); } collapse_messages(); }