Misc updates, improve global API, start work on db and module strings

This commit is contained in:
2024-06-25 02:08:49 +02:00
parent 7d426e9497
commit 8f1b80ab14
26 changed files with 389 additions and 210 deletions

View File

@@ -0,0 +1,20 @@
# ================================== #
# WinDog multi-purpose chatbot #
# Licensed under AGPLv3 by OctoSpacc #
# ================================== #
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'))})
destination = data.command.arguments["destination"]
if not (destination and data.command.body):
return SendMessage(context, {"Text": "Bad usage."})
SendMessage(context, {"TextPlain": data.command.body}, destination)
SendMessage(context, {"TextPlain": "Executed."})
RegisterModule(name="Broadcast", endpoints=[
SafeNamespace(names=["broadcast"], summary="Sends an admin message over to any chat destination.", handler=cBroadcast, arguments={
"destination": True,
}),
])