mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-26 15:07:03 +01:00
Fixes and Handling nick mentions to usernames
This commit is contained in:
parent
aaaf735554
commit
f5d53dd89a
@ -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
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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 %}
|
||||||
|
Loading…
Reference in New Issue
Block a user