mirror of
https://gitlab.com/octospacc/WinDog.git
synced 2025-06-05 22:09:20 +02:00
Update /dalle, /translate; Add /craiyon, /gpt; More restructuring
This commit is contained in:
20
ModWinDog/Broadcast.py
Executable file
20
ModWinDog/Broadcast.py
Executable 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,
|
||||
}),
|
||||
})
|
||||
|
Reference in New Issue
Block a user