Improved module priority handling
This commit is contained in:
@@ -5,7 +5,10 @@ import discord
|
||||
class ModuleABC(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self): pass
|
||||
|
||||
@abstractmethod
|
||||
def get_priority(self, t: type) -> int: pass
|
||||
def __init__(self):
|
||||
self._priorities = {}
|
||||
|
||||
def get_priority(self, t: type) -> int:
|
||||
if t not in self._priorities:
|
||||
raise Exception(f'Priority for {t} not found!')
|
||||
return self._priorities[t]
|
||||
|
Reference in New Issue
Block a user