Cleanup Locale system, remove legacy Locale API, add command help handling, misc

This commit is contained in:
2024-08-07 02:27:17 +02:00
parent 6a1a21027c
commit c9895a4bed
37 changed files with 314 additions and 297 deletions

View File

@ -6,11 +6,12 @@
from json import dumps as json_dumps
def cDump(context:EventContext, data:InputMessageData):
if not (message := ObjGet(data, "quoted")):
pass # TODO send error message
SendMessage(context, {"TextPlain": json_dumps(message, default=(lambda obj: obj.__dict__), indent=" ")})
SendMessage(context, {
"text_html": (f'<pre>{json_dumps(message, default=(lambda obj: obj.__dict__), indent=" ")}</pre>'
if (message := ObjGet(data, "quoted"))
else context.endpoint.help_text(data.user.settings.language))})
RegisterModule(name="Dumper", group="Geek", endpoints=[
SafeNamespace(names=["dump"], handler=cDump),
SafeNamespace(names=["dump"], handler=cDump, quoted=True),
])