48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
from abc import ABCMeta
|
|
import help_module
|
|
|
|
from commands.command_base import AbstractCommand
|
|
|
|
import random
|
|
|
|
import utilities_script as utilities
|
|
|
|
class CommandChyron(AbstractCommand, metaclass=ABCMeta):
|
|
"""
|
|
this is the help command.
|
|
"""
|
|
command = "help"
|
|
|
|
def __init__(self):
|
|
super().__init__(CommandChyron.command, n_args=5, command_type=AbstractCommand.CommandType.Praxis)
|
|
self.help = ["This is a command to learn more about other commands.",
|
|
"\nExample:","help \"COMMAND\""]
|
|
|
|
self.blockDecor = "\n================================================================\n"
|
|
|
|
def do_command(self, bot, user_message):
|
|
tempBool = True
|
|
if tempBool == True:
|
|
tempParsedMessage = user_message.message.split(" ")
|
|
i = len(tempParsedMessage)
|
|
|
|
if i > 1:
|
|
targetCommand = bot.commands[tempParsedMessage[1]]
|
|
helper = help_module.Help_Module_.help_command_response(targetCommand, help_module.help_command_responseType.fancy)
|
|
|
|
returnMessage = helper.response
|
|
bot.return_message(returnMessage)
|
|
elif i == 1:
|
|
commandsList = self.blockDecor + "Commands List:" + self.blockDecor + self.GetCommandsList(bot) + self.blockDecor
|
|
print(commandsList)
|
|
|
|
def GetCommandsList(self, bot):
|
|
commandsList = ""
|
|
i = 0
|
|
for cmd in bot.commands:
|
|
commandsList = commandsList + cmd + "\n"
|
|
|
|
return commandsList
|
|
|
|
def get_help(self):
|
|
return self.help |