Added Commands & changed prefix
Added restart and shutdown commands to the twitch bot module.
This commit is contained in:
parent
f81a2c6512
commit
dfbeb63aef
18
commands/implemented/command_restartBot.py
Normal file
18
commands/implemented/command_restartBot.py
Normal file
@ -0,0 +1,18 @@
|
||||
from abc import ABCMeta
|
||||
|
||||
from commands.command_base import AbstractCommand
|
||||
|
||||
import utilities_script as utilities
|
||||
|
||||
class CommandTTS(AbstractCommand, metaclass=ABCMeta):
|
||||
command = "//restart"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(CommandTTS.command, n_args=0, command_type=AbstractCommand.CommandType.TWITCH)
|
||||
|
||||
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 restarting...")
|
||||
utilities.restart_self()
|
||||
|
||||
18
commands/implemented/command_shutdownBot.py
Normal file
18
commands/implemented/command_shutdownBot.py
Normal file
@ -0,0 +1,18 @@
|
||||
from abc import ABCMeta
|
||||
|
||||
from commands.command_base import AbstractCommand
|
||||
|
||||
import utilities_script as utilities
|
||||
|
||||
class CommandTTS(AbstractCommand, metaclass=ABCMeta):
|
||||
command = "//shutdown"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(CommandTTS.command, n_args=0, command_type=AbstractCommand.CommandType.TWITCH)
|
||||
|
||||
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()
|
||||
|
||||
@ -5,7 +5,7 @@ from commands.command_base import AbstractCommand
|
||||
|
||||
|
||||
class CommandTTS(AbstractCommand, metaclass=ABCMeta):
|
||||
command = "!tts"
|
||||
command = "//tts"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(CommandTTS.command, n_args=1, command_type=AbstractCommand.CommandType.TWITCH)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user