Update /dalle, /translate; Add /craiyon, /gpt; More restructuring

This commit is contained in:
2024-06-20 01:45:51 +02:00
parent 4c403e516b
commit 7d426e9497
14 changed files with 296 additions and 236 deletions

View File

@ -4,7 +4,7 @@
# ================================== #
# TODO: implement /help <commandname> feature
def cHelp(context, data=None) -> None:
def cHelp(context:EventContext, data:InputMessageData) -> None:
moduleList = ''
for module in Modules:
summary = Modules[module]["summary"]
@ -13,7 +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 ''))
SendMsg(context, {"Text": f"[ Available Modules ]{moduleList}"})
SendMessage(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),