@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
39 lines (38 loc) • 1.59 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageReply = void 0;
/* eslint-disable @typescript-eslint/ban-ts-comment */
const Base_1 = require("./Base");
const MessageReplyParent_1 = require("./MessageReplyParent");
const MessageReplyThread_1 = require("./MessageReplyThread");
/**
* Represents a message reply.
*/
class MessageReply extends Base_1.Base {
/**
* The parent of the reply. This is the message which was replied.
*/
parent;
/**
* The thread of the reply. This is the message which started the reply thread.
*/
thread;
/**
* The data of the reply.
*/
// @ts-ignore
data;
/**
* Creates a new instance of the message reply.
* @param chatbot The current instance of the chatbot.
* @param data The data of the reply.
* @param chatroom The chatroom where the reply was sent.
*/
constructor(chatbot, data, chatroom) {
super(chatbot);
this.data = data;
this.parent = new MessageReplyParent_1.MessageReplyParent(chatbot, { id: data.parent.message.id, content: data.parent.message.content, user_id: data.parent.user.id, user_name: data.parent.user.displayName, user_login: data.parent.user.login, chatroom_id: chatroom.id }, chatroom);
this.thread = new MessageReplyThread_1.MessageReplyThread(chatbot, { id: data.thread.messageId, user_id: data.thread.user.id, user_name: data.thread.user.displayName, user_login: data.thread.user.login, chatroom_id: chatroom.id }, chatroom);
}
}
exports.MessageReply = MessageReply;