mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
v0.2.0
This commit is contained in:
@@ -8,16 +8,15 @@ from ..router.exceptions import (InvalidCommandInstanceException,
|
||||
class Router:
|
||||
def __init__(self,
|
||||
title: str = 'Commands group title:',
|
||||
name: str = 'subordinate',
|
||||
ignore_command_register: bool = False):
|
||||
name: str = 'subordinate'):
|
||||
|
||||
self.ignore_command_register = ignore_command_register
|
||||
self.title = title
|
||||
self.name = name
|
||||
|
||||
self._command_entities: list[dict[str, Callable[[], None] | str]] = []
|
||||
self.unknown_command_func: Callable[[str], None] | None = None
|
||||
self._is_main_router: bool = False
|
||||
self.ignore_command_register: bool = False
|
||||
|
||||
|
||||
def command(self, command: str, description: str = None) -> Callable[[Any], Any]:
|
||||
@@ -86,6 +85,10 @@ class Router:
|
||||
self._is_main_router = True
|
||||
|
||||
|
||||
def set_ignore_command_register(self, ignore_command_register: bool):
|
||||
self.ignore_command_register = ignore_command_register
|
||||
|
||||
|
||||
def get_command_entities(self) -> list[dict[str, Callable[[], None] | str]]:
|
||||
return self._command_entities
|
||||
|
||||
|
||||
Reference in New Issue
Block a user