Total Complexity | 1 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # Copyright Pincer 2021-Present |
||
|
|||
2 | # Full MIT License can be found in `LICENSE` at the project root. |
||
3 | |||
4 | from typing import Callable, Dict |
||
5 | |||
6 | from ...utils.types import Singleton |
||
7 | |||
8 | |||
9 | class ComponentHandler(metaclass=Singleton): |
||
10 | """Handles registered components |
||
11 | |||
12 | Attributes |
||
13 | ---------- |
||
14 | register : Dict[:class:`str`, :class:`Callable`] |
||
15 | Dictionary of registered buttons. |
||
16 | """ |
||
17 | |||
18 | register: Dict[str, Callable] = {} |
||
19 | |||
20 | def register_id(self, _id: str, func: Callable): |
||
21 | self.register[_id] = func |
||
22 |