16 lines
581 B
Python
16 lines
581 B
Python
|
from os import listdir
|
||
|
from core.main import *
|
||
|
from utils.logging.log import *
|
||
|
import commands
|
||
|
|
||
|
def loadCommands(func):
|
||
|
for filename in listdir('commands'):
|
||
|
if filename.endswith('.py') and filename != "__init__.py":
|
||
|
commandName = filename[0:-3]
|
||
|
className = commandName.capitalize()
|
||
|
#try:
|
||
|
__import__('commands.%s' % commandName)
|
||
|
eval('commands.%s.%s(func)' % (commandName, className))
|
||
|
#except Exception as err:
|
||
|
# error("Exception while loading command %s:\n%s" % (commandName, err))
|