mirror of
https://github.com/open-webui/open-webui
synced 2025-05-13 10:03:15 +00:00
refac: discord webhook
This commit is contained in:
parent
2fd7bbc259
commit
423fee347a
@ -19,7 +19,11 @@ def post_webhook(url: str, message: str, event_data: dict) -> bool:
|
|||||||
payload["text"] = message
|
payload["text"] = message
|
||||||
# Discord Webhooks
|
# Discord Webhooks
|
||||||
elif "https://discord.com/api/webhooks" in url:
|
elif "https://discord.com/api/webhooks" in url:
|
||||||
payload["content"] = message
|
payload["content"] = (
|
||||||
|
message
|
||||||
|
if len(message) > 2000
|
||||||
|
else f"{message[: 2000 - 14]}... (truncated)"
|
||||||
|
)
|
||||||
# Microsoft Teams Webhooks
|
# Microsoft Teams Webhooks
|
||||||
elif "webhook.office.com" in url:
|
elif "webhook.office.com" in url:
|
||||||
action = event_data.get("action", "undefined")
|
action = event_data.get("action", "undefined")
|
||||||
|
Loading…
Reference in New Issue
Block a user