from abc import ABCMeta import twitch.chat from commands.command_base import AbstractCommand from twitch_script import Twitch_Module class CommandTTS(AbstractCommand, metaclass=ABCMeta): command = "!tts" def __init__(self): super().__init__(CommandTTS.command, n_args=1, command_type=AbstractCommand.CommandType.TWITCH) def do_command(self, bot: Twitch_Module, twitch_message: twitch.chat.Message): args = self.get_args(twitch_message.text) if args[1] == "start": bot.send_message("tts activated on #%s" % twitch_message.channel) bot.tts_enabled = True elif args[1] == "stop": bot.send_message("tts deactivated") bot.tts_enabled = False