Start Matrix support, more refactoring, cleaner /help and /translate

This commit is contained in:
2024-06-17 00:32:03 +02:00
parent d687cbd51e
commit 09cf925850
19 changed files with 236 additions and 189 deletions

View File

@ -1,7 +1,11 @@
# TODO: implement /help <commandname> feature
# ================================== #
# WinDog multi-purpose chatbot #
# Licensed under AGPLv3 by OctoSpacc #
# ================================== #
# TODO: implement /help <commandname> feature
def cHelp(context, data=None) -> None:
moduleList, commands = '', ''
moduleList = ''
for module in Modules:
summary = Modules[module]["summary"]
endpoints = Modules[module]["endpoints"]
@ -9,9 +13,7 @@ def cHelp(context, data=None) -> None:
for endpoint in endpoints:
summary = endpoints[endpoint]["summary"]
moduleList += (f"\n* /{', /'.join(endpoints[endpoint]['names'])}" + (f": {summary}" if summary else ''))
for cmd in Endpoints.keys():
commands += f'* /{cmd}\n'
SendMsg(context, {"Text": f"[ Available Modules ]{moduleList}\n\nFull Endpoints List:\n{commands}"})
SendMsg(context, {"Text": f"[ Available Modules ]{moduleList}"})
RegisterModule(name="Help", group="Basic", endpoints={
"Help": CreateEndpoint(["help"], summary="Provides help for the bot. For now, it just lists the commands.", handler=cHelp),