UNPKG

hackmud-chat

Version:
24 lines 686 B
"use strict"; 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