@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
28 lines (27 loc) • 959 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChatBotWarnsManager = void 0;
const Base_1 = require("../Base");
const Warning_1 = require("../Warning");
/**
* The warns manager of the chatbot.
*/
class ChatBotWarnsManager extends Base_1.Base {
/**
* Creates a new instance of the warns manager.
* @param chatbot The current instance of the chatbot.
*/
constructor(chatbot) {
super(chatbot);
}
/**
* 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(chatroomId, userId, reason) {
return new Warning_1.Warning(this.chatbot, await this.chatbot.helixClient.warnChatUser(chatroomId, this.chatbot.userId, { data: { user_id: userId, reason } }));
}
}
exports.ChatBotWarnsManager = ChatBotWarnsManager;