Praxis_Bot/Command_Management_Module.py
2021-04-27 18:47:51 -04:00

52 lines
1.5 KiB
Python

from main import user_module_init
import config as config
import db
import user_module
import commands.loader as command_loader
from commands.command_base import AbstractCommand
import credentials
import os
import praxis_logging
praxis_logger_obj = praxis_logging.praxis_logger()
praxis_logger_obj.init(os.path.basename(__file__))
praxis_logger_obj.log("\n -Starting Logs: " + os.path.basename(__file__))
class Command_Management_Module():
def __init__(self):
super().__init__()
self.dbCredential: credentials.DB_Credential
def main_test(self):
praxis_logger_obj.log("[TEST Module]> test")
tempModule = user_module.User_Module()
#tempModule.commands = command_loader.load_commands_new(AbstractCommand.CommandType.Praxis)
praxis_logger_obj.log(self.getCommandsList(tempModule.commands))
def getCommandsList(self, targetModuleCommands):
praxis_logger_obj.log(type(targetModuleCommands))
commandsList = "\n"
for cmd in targetModuleCommands:
targetCommand = targetModuleCommands[cmd]
praxis_logger_obj.log(targetCommand.command)
praxis_logger_obj.log(targetCommand.isCommandEnabled)
return commandsList
def getUserPermission():
pass
if __name__ == "__main__":
testModule = Command_Management_Module()
credentials_manager = credentials.Credentials_Module()
credentials_manager.load_credentials()
testModule.dbCredential = credentials_manager.find_DB_Credential(config.credentialsNickname)
testModule.main_test()