hardlounge/lib/models/msg.js

30 lines
487 B
JavaScript
Raw Normal View History

2014-06-26 23:05:47 +00:00
var _ = require("lodash");
var moment = require("moment");
Msg.Type = {
2014-06-29 19:41:02 +00:00
ACTION: "action",
2014-06-26 23:05:47 +00:00
ERROR: "error",
JOIN: "join",
KICK: "kick",
MESSAGE: "message",
MODE: "mode",
MOTD: "motd",
NICK: "nick",
NOTICE: "notice",
PART: "part",
QUIT: "quit",
TOPIC: "topic",
WHOIS: "whois"
};
module.exports = Msg;
function Msg(attr) {
_.merge(this, _.extend({
type: Msg.Type.MESSAGE,
time: moment().format("HH:mm"),
from: "",
text: ""
}, attr));
}