mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-18 00:35:36 +00:00
callable fix
This commit is contained in:
parent
4d8cd4e559
commit
04a5159707
@ -19,9 +19,10 @@ class EventsSystem:
|
||||
|
||||
def register_event(self, event_name, event_func):
|
||||
self.log.debug(f"register_event({event_name}, {event_func}):")
|
||||
if callable(event_func):
|
||||
if not callable(event_func):
|
||||
self.log.error(f"Cannot add event '{event_name}'. "
|
||||
f"Use `BEAMP.add_event({event_name}', function)` instead. Skipping it...")
|
||||
return
|
||||
if event_name not in self.__events:
|
||||
self.__events.update({str(event_name): [event_func]})
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user