from abc import ABCMeta from commands.command_base import AbstractCommand import discord import discord.message import utilities_script as utilities class ShutdownCommand_Twitch(AbstractCommand, metaclass=ABCMeta): command = "!shutdown" def __init__(self): super().__init__(ShutdownCommand_Twitch.command, n_args=0, 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 twitch_message.sender.lower() == twitch_message.channel: bot.send_message("Bot shutting down...") utilities.hard_shutdown() def get_help(self): return self.help class ShutdownCommand_Discord(AbstractCommand, metaclass=ABCMeta): command = "//shutdown" def __init__(self): super().__init__(ShutdownCommand_Discord.command, n_args=0, 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): if str(discord_message.author.top_role) == "Admin": print("Admin Check") #response = str("Bot restarting... on %s" % discord_message.guild.name) response = str("Bot shutting down...") await bot.send_message(discord_message, response) utilities.hard_shutdown() def get_help(self): return self.help