Fixes and Handling nick mentions to usernames

This commit is contained in:
Jeremy Zhang 2017-04-05 07:31:42 +00:00
parent aaaf735554
commit f5d53dd89a
3 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@
Discord webpage embedded client Discord webpage embedded client
## Required PIP Packages ## Required PIP Packages
- flask
- flask-sqlalchemy - flask-sqlalchemy
- cachetools - cachetools
- Flask-Cache - Flask-Cache

View File

@ -217,6 +217,7 @@ function replace_message_mentions(message) {
for (var i = 0; i < mentions.length; i++) { for (var i = 0; i < mentions.length; i++) {
var mention = mentions[i]; var mention = mentions[i];
message.content = message.content.replace(new RegExp("<@" + mention.id + ">", 'g'), "@" + mention.username + "#" + mention.discriminator); message.content = message.content.replace(new RegExp("<@" + mention.id + ">", 'g'), "@" + mention.username + "#" + mention.discriminator);
message.content = message.content.replace(new RegExp("<@!" + mention.id + ">", 'g'), "@" + mention.username + "#" + mention.discriminator);
} }
return message; return message;
} }

View File

@ -26,7 +26,7 @@
<div class="nav-wrapper container"> <div class="nav-wrapper container">
<a href="/" class="brand-logo"><b>Titan</b>Embeds <span class="betatag">BETA</span></a> <a href="/" class="brand-logo"><b>Titan</b>Embeds <span class="betatag">BETA</span></a>
<ul id="nav-mobile" class="right"> <ul id="nav-mobile" class="right">
<li><a href="{{url_for("embed.guild_embed", guild_id="295085744249110529")}}" class="waves-effect btn z-depth-3">Visit Us!</a></li> <!-- TODO: Add discord guild invite --> <li><a href="{{url_for("embed.guild_embed", guild_id="295085744249110529")}}" class="waves-effect btn z-depth-3">Visit Us!</a></li>
{% if session['unauthenticated'] is defined and not session['unauthenticated'] %} {% if session['unauthenticated'] is defined and not session['unauthenticated'] %}
<li><a id="menu_drop" data-activates="menu_dropdown" class="waves-effect btn z-depth-3 btn-floating dropdown-button avatar_menu" style='background-image: url(" {{ session['avatar'] }} ")'></a></li> <li><a id="menu_drop" data-activates="menu_dropdown" class="waves-effect btn z-depth-3 btn-floating dropdown-button avatar_menu" style='background-image: url(" {{ session['avatar'] }} ")'></a></li>
{% else %} {% else %}