from nio import RoomMessageText import typing routes = {} helptxt = {} def add_route(cmd: str, hlp: str, func: typing.Callable) -> None: if cmd not in routes.keys(): routes[cmd] = func helptxt[cmd] = hlp async def handle_command(command: str, room: str, event: RoomMessageText, args: list): import utils if command in routes.keys(): await routes[command](utils.get_client(), room, event, args)