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

20
ModWinDog/Broadcast.py Executable file
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={
"Broadcast": CreateEndpoint(["broadcast"], summary="Sends an admin message over to any chat destination.", handler=cBroadcast, arguments={
"destination": True,
}),
})