@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
34 lines (33 loc) • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WarnsManager = void 0;
const Base_1 = require("../Base");
const Warning_1 = require("../Warning");
/**
* The warns manager of a chatroom.
*/
class WarnsManager extends Base_1.Base {
/**
* The chatroom instance.
*/
chatroom;
/**
* Creates a new instance of the warns manager.
* @param chatbot The current instance of the chatbot.
* @param chatroom The chatroom instance.
*/
constructor(chatbot, chatroom) {
super(chatbot);
this.chatroom = chatroom;
}
/**
* Creates warn for an user in a specific chatroom.
* @param chatroomId The id of the chatroom where the user will be warned.
* @param userId The id of the user to warn.
* @returns
*/
async create(userId, reason) {
return new Warning_1.Warning(this.chatbot, await this.chatbot.helixClient.warnChatUser(this.chatroom.id, this.chatbot.userId, { data: { user_id: userId, reason } }));
}
}
exports.WarnsManager = WarnsManager;