UNPKG

@twitchfy/chatbot

Version:

A powerful node module to make your own Twitch ChatBot

40 lines (39 loc) 1.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AutoModSettingsManager = void 0; const AutoModSettings_1 = require("../AutoModSettings"); const Base_1 = require("../Base"); /** * Represents the manager for the settings of the autmod. */ class AutoModSettingsManager extends Base_1.Base { /** * The automod instance. */ automod; /** * Creates a new instance of the automod settings manager. * @param chatbot The current instance of the chatbot. * @param automod The automod instance. */ constructor(chatbot, automod) { super(chatbot); this.automod = automod; } /** * Edits the automod settings. * @param options The options to edit the automod settings. * @returns The new settings of the automod. */ async edit(options) { return new AutoModSettings_1.AutoModSettings(this.chatbot, this.automod, await this.chatbot.helixClient.updateAutoModSettings(this.automod.chatroom.id, this.chatbot.userId, options)); } /** * Fetches the current settings of the automod from the API. * @returns The current settings of the automod. */ async fetch() { return new AutoModSettings_1.AutoModSettings(this.chatbot, this.automod, await this.chatbot.helixClient.getAutoModSettings(this.automod.chatroom.id, this.chatbot.userId)); } } exports.AutoModSettingsManager = AutoModSettingsManager;