@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
40 lines (39 loc) • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimeoutManager = void 0;
const Base_1 = require("../Base");
/**
* The timeout manager of a chatroom.
*/
class TimeoutManager extends Base_1.Base {
/**
* The chatroom instance.
*/
chatroom;
/**
* Creates a new instance of the timeout manager.
* @param chatbot The current instance of the chatbot.
* @param chatroom The chatroom instance.
*/
constructor(chatbot, chatroom) {
super(chatbot);
this.chatroom = chatroom;
}
/**
* Timeout a specific user within the chatroom.
* @param options The options required for send an user into a timeout. See {@link TimeoutOptions}.
* @returns
*/
async add(options) {
return await this.chatbot.timeouts.add(this.chatroom.id, options);
}
/**
* Deletes the timeout of a specific user within the chatroom.
* @param userId The id of the user to remove from the timeout.
* @returns
*/
async delete(userId) {
return await this.chatbot.timeouts.delete(this.chatroom.id, userId);
}
}
exports.TimeoutManager = TimeoutManager;