mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-12-11 13:21:40 +00:00
22 lines
No EOL
385 B
JavaScript
22 lines
No EOL
385 B
JavaScript
"use strict";
|
|
|
|
var Author = require("./author");
|
|
|
|
function Message (o) {
|
|
this.author = Author(o.author);
|
|
this.content = o.content;
|
|
this.createdAt = new Date();
|
|
};
|
|
|
|
Message.prototype.toJson = function () {
|
|
return {
|
|
author: {
|
|
username: this.author.username,
|
|
avatar: this.author.avatar
|
|
},
|
|
content: this.content,
|
|
createdAt: this.createdAt
|
|
}
|
|
};
|
|
|
|
module.exports = Message; |