UNPKG

@twitchfy/chatbot

Version:

A powerful node module to make your own Twitch ChatBot

40 lines (39 loc) 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MessageManager = void 0; const Base_1 = require("../Base"); /** * Represents the manager for the messages of a chatroom. */ class MessageManager extends Base_1.Base { /** * The chatroom instance. */ chatroom; /** * Creates a new instance of the message manager. * @param chatbot The current instance of the chatbot. * @param chatroom The chatroom instance. */ constructor(chatbot, chatroom) { super(chatbot); this.chatroom = chatroom; } /** * Deletes a message from the chatroom. * @param id The id of the message to delete. * @returns */ async delete(id) { return await this.chatbot.messages.delete(id, this.chatroom.id); } /** * Sends a message to the chatroom. * @param message The message to send. * @returns The message which was sent. */ async send(message) { return await this.chatbot.messages.send(this.chatroom.id, message); } } exports.MessageManager = MessageManager;