Added createServer

This commit is contained in:
hydrabolt
2015-11-01 13:08:17 +00:00
parent b8aaa590b4
commit 0fe42c61da
10 changed files with 205 additions and 9 deletions

View File

@@ -13,7 +13,7 @@ var Message = (function () {
this.channel = channel;
this.client = client;
console.log("update", data);
this.nonce = data.nonce;
this.attachments = data.attachments;
this.tts = data.tts;
@@ -23,7 +23,9 @@ var Message = (function () {
this.id = data.id;
if (data.edited_timestamp) this.editedTimestamp = Date.parse(data.edited_timestamp);
this.author = client.internal.users.add(new User(data.author, client));
if (data.author instanceof User) this.author = data.author;else this.author = client.internal.users.add(new User(data.author, client));
this.content = data.content;
this.mentions = new Cache();
@@ -31,7 +33,7 @@ var Message = (function () {
// 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.
_this.mentions.add(client.internal.users.add(new User(mention, client)));
if (mention instanceof User) _this.mentions.push(mention);else _this.mentions.add(client.internal.users.add(new User(mention, client)));
});
}