In-order + duplicate mentions, cleanContent in Messages

This commit is contained in:
abalabahaha
2016-01-29 22:05:01 -08:00
parent 8b392f359a
commit e3173d1561
4 changed files with 21 additions and 9 deletions

View File

@@ -48,9 +48,12 @@ var Message = (function (_Equality) {
if (data.author instanceof _User2["default"]) this.author = data.author;else this.author = client.internal.users.add(new _User2["default"](data.author, client));
this.content = data.content;
var mentionData = client.internal.resolver.resolveMentions(data.content);
this.cleanContent = mentionData[1];
this.mentions = new _UtilCache2["default"]();
data.mentions.forEach(function (mention) {
mentionData[0].forEach(function (mention) {
// this is .add and not .get because it allows the bot to cache
// users from messages from logs who may have left the server and were
// not previously cached.