mirror of
https://gitlab.com/octospacc/WinDog.git
synced 2025-06-05 22:09:20 +02:00
21 lines
854 B
Python
Executable File
21 lines
854 B
Python
Executable File
# ================================== #
|
|
# 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,
|
|
}),
|
|
})
|
|
|