mirror of
https://git.freetards.xyz/array.in.a.matrix/TexLiLy.git
synced 2025-04-02 13:21:42 -04:00
16 lines
438 B
Python
16 lines
438 B
Python
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)
|
|
|