mirror of
https://gitlab.com/octospacc/WinDog.git
synced 2025-06-05 22:09:20 +02:00
Start Matrix support, more refactoring, cleaner /help and /translate
This commit is contained in:
@ -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),
|
||||
|
Reference in New Issue
Block a user