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

@@ -5,7 +5,7 @@
def cBroadcast(context:EventContext, data:InputMessageData) -> None:
if (data.user.id not in AdminIds) and (data.user.tag not in AdminIds):
return SendMessage(context, {"Text": choice(Locale.__('eval'))})
return SendMessage(context, {"Text": "Permission denied."})
destination = data.command.arguments["destination"]
text = data.command.body
if not (destination and text):
@@ -14,7 +14,7 @@ def cBroadcast(context:EventContext, data:InputMessageData) -> None:
SendMessage(context, OutputMessageData(text_plain="Executed."))
RegisterModule(name="Broadcast", endpoints=[
SafeNamespace(names=["broadcast"], handler=cBroadcast, arguments={
SafeNamespace(names=["broadcast"], handler=cBroadcast, body=True, arguments={
"destination": True,
}),
])