twitch-chat-client
Version:
Interact with the Twitch Messaging Interface (aka Twitch chat).
62 lines • 2.1 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var Commands_1 = require("ircv3/lib/Message/MessageTypes/Commands/");
var ChatUser_1 = require("../ChatUser");
var ChatTools_1 = require("../Toolkit/ChatTools");
var TwitchPrivateMessage = /** @class */ (function (_super) {
tslib_1.__extends(TwitchPrivateMessage, _super);
function TwitchPrivateMessage() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(TwitchPrivateMessage.prototype, "userInfo", {
get: function () {
return new ChatUser_1.default(this._prefix.nick, this._tags);
},
enumerable: true,
configurable: true
});
Object.defineProperty(TwitchPrivateMessage.prototype, "channelId", {
get: function () {
if (!this._tags) {
return null;
}
return this._tags.get('room-id') || null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(TwitchPrivateMessage.prototype, "isCheer", {
get: function () {
if (!this._tags) {
return false;
}
return this._tags.has('bits');
},
enumerable: true,
configurable: true
});
Object.defineProperty(TwitchPrivateMessage.prototype, "totalBits", {
get: function () {
if (!this._tags) {
return 0;
}
return Number(this._tags.get('bits'));
},
enumerable: true,
configurable: true
});
Object.defineProperty(TwitchPrivateMessage.prototype, "emoteOffsets", {
get: function () {
if (!this._tags) {
return new Map;
}
return ChatTools_1.parseEmotes(this._tags.get('emotes'));
},
enumerable: true,
configurable: true
});
return TwitchPrivateMessage;
}(Commands_1.PrivateMessage));
exports.default = TwitchPrivateMessage;
//# sourceMappingURL=PrivateMessage.js.map
;