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

@ -217,6 +217,7 @@ function replace_message_mentions(message) {
for (var i = 0; i < mentions.length; 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);
}
return message;
}