from abc import ABCMeta from commands.command_base import AbstractCommand import discord import discord.message class CommandTTS_Twitch(AbstractCommand, metaclass=ABCMeta): command = "!tts" def __init__(self): super().__init__(CommandTTS_Twitch.command, n_args=1, command_type=AbstractCommand.CommandType.TWITCH) self.help = ["MISSING HELP ENTRY", "\nExample:","command \"PARAM\""] self.isCommandEnabled = True def do_command(self, bot, twitch_message): args = self.get_args(twitch_message.text) if args[1] == "start": if twitch_message.sender.lower() == twitch_message.channel: bot.send_message("tts activated on #%s" % twitch_message.channel) bot.tts_enabled = True elif args[1] == "stop": if twitch_message.sender.lower() == twitch_message.channel: bot.send_message("tts deactivated on #%s" % twitch_message.channel) bot.tts_enabled = False def get_help(self): return self.help class CommandTTS_Discord(AbstractCommand, metaclass=ABCMeta): command = "//tts" def __init__(self): super().__init__(CommandTTS_Discord.command, n_args=1, command_type=AbstractCommand.CommandType.DISCORD) self.help = ["MISSING HELP ENTRY", "\nExample:","command \"PARAM\""] self.isCommandEnabled = True async def do_command(self, bot, discord_message: discord.message): args = self.get_args(discord_message.content) if args[1] == "start": print(discord_message.author.top_role) print("start detected") if str(discord_message.author.top_role) == "Admin": print("Admin Check") response = str("tts activated on %s" % discord_message.guild.name) await bot.send_message(discord_message, response) bot.tts_enabled = True elif args[1] == "stop": print("stop detected") if str(discord_message.author.top_role) == "Admin": print("Admin Check") response = str("tts deactivated on %s" % discord_message.guild.name) await bot.send_message(discord_message, response) bot.tts_enabled = False def get_help(self): return self.help