@twitchfy/chatbot
Version:
A powerful node module to make your own Twitch ChatBot
40 lines (39 loc) • 1.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BanManager = void 0;
const Base_1 = require("../Base");
/**
* The ban manager of a chatroom.
*/
class BanManager extends Base_1.Base {
/**
* The chatroom which includes this manager.
*/
chatroom;
/**
* Creates a new instance of the badge manager.
* @param chatbot The current instance of the chatbot.
* @param chatroom The chatroom which includes this manager.
*/
constructor(chatbot, chatroom) {
super(chatbot);
this.chatroom = chatroom;
}
/**
* Ban a specific user.
* @param options The options required for banning an user. See {@link BanOptions}.
* @returns A class representation of the ban. See {@link Ban}.
*/
async add(options) {
return await this.chatbot.bans.add(this.chatroom.id, options);
}
/**
* Deletes the ban of a specific user.
* @param userId The id of the user to unban.
* @returns
*/
async delete(userId) {
return await this.chatbot.bans.delete(this.chatroom.id, userId);
}
}
exports.BanManager = BanManager;