hackmud-chat
Version:
A hackmud chat api wrapper for nodejs.
24 lines • 686 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
/**
* A abstract class that represents a message.
*
* You will usually want to check if it's a instance of `ChannelMessage` or `PrivateMessage`.
*/
class Message {
constructor(accountUser, fromUser, msg, t, id) {
this.fromUser = fromUser;
this.msg = msg;
this.t = t;
this.id = id;
this.accountUser = accountUser;
}
/**
* Wether this message is sent by the account user.
*/
isOwnMessage() {
return this.accountUser.name === this.fromUser;
}
}
exports.Message = Message;
//# sourceMappingURL=message.js.map
;