@twurple/chat
Version:
Interact with the Twitch Messaging Interface (aka Twitch chat).
34 lines (33 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserNotice = void 0;
const ircv3_1 = require("ircv3");
const ChatUser_1 = require("../../../ChatUser");
const emoteUtil_1 = require("../../../utils/emoteUtil");
class UserNotice extends ircv3_1.Message {
constructor(command, contents, config) {
super(command, contents, config, {
channel: { type: 'channel' },
text: { trailing: true, optional: true },
});
}
get id() {
return this._tags.get('id');
}
get date() {
const timestamp = this._tags.get('tmi-sent-ts');
return new Date(Number(timestamp));
}
get userInfo() {
return new ChatUser_1.ChatUser(this._tags.get('login'), this._tags);
}
get channelId() {
var _a;
return (_a = this._tags.get('room-id')) !== null && _a !== void 0 ? _a : null;
}
get emoteOffsets() {
return (0, emoteUtil_1.parseEmoteOffsets)(this._tags.get('emotes'));
}
}
exports.UserNotice = UserNotice;
UserNotice.COMMAND = 'USERNOTICE';