This commit is contained in:
2023-07-05 17:47:59 +03:00
parent 56c1da1134
commit 4d8cd4e559
3 changed files with 9 additions and 13 deletions

View File

@@ -7,7 +7,6 @@ class EventsSystem:
def __init__(self):
self.__events = {
"on_starting": [self.on_starting],
"on_started": [self.on_started],
"on_stop": [self.on_stop],
"on_auth": [self.on_auth]
@@ -36,9 +35,6 @@ class EventsSystem:
else:
self.log.warning(f"Event {event_name} does not exist. Just skipping it...")
def on_starting(self):
pass
def on_started(self):
pass

View File

@@ -9,7 +9,7 @@ class BEAMP:
def __init__(self, name=None):
if name is None:
raise Exception("BEAMP: Name is required")
self.log = get_logger(f"BEAMP({name})")
self.log = get_logger(f"PluginsLoader | {name}")
self.name = name
def set_name(self, name):
@@ -41,6 +41,7 @@ class PluginsLoader:
self.log.debug(f"Loading plugin: {file}")
plugin = types.ModuleType('plugin')
plugin.BEAMP = BEAMP
plugin.print = print
file = os.path.join(self.__plugins_dir, file)
with open(f'{file}', 'r') as f:
code = f.read().replace("import BEAMP\n", "")