mirror of
https://git.freetards.xyz/array.in.a.matrix/TexLiLy.git
synced 2025-04-02 13:21:42 -04:00
28 lines
834 B
Python
28 lines
834 B
Python
from nio import *
|
|
|
|
async def route_help(client: Client, room: str, event: RoomMessageText, args: list) -> None:
|
|
import router
|
|
import utils
|
|
|
|
txt = "Commands for TeXLily:\n"
|
|
|
|
for cmd in router.routes.keys():
|
|
txt += f"\ttxt!{cmd}: {router.helptxt[cmd]}\n"
|
|
|
|
await utils.send_msg(client, room, txt)
|
|
|
|
async def route_delete(client: Client, room: str, event: RoomMessageText, args: list) -> None:
|
|
if len(args) == 1:
|
|
import utils
|
|
import os
|
|
|
|
directory = utils.create_user_dir(event.sender)
|
|
|
|
file = os.path.join(directory, args[0] + ".sty")
|
|
|
|
try:
|
|
os.remove(file)
|
|
await utils.send_msg(client, room, "Deleted!")
|
|
except FileNotFoundError:
|
|
await utils.send_msg(client, room, f"Couldn't delete style {args[0]}")
|
|
pass
|