Switch Discord notifications from webhook to user ID DMs

Uses the existing bot token to send DMs to users by their Discord user ID
instead of posting to a channel webhook.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 02:14:46 -06:00
parent c29ec8e210
commit 1cb929a776
5 changed files with 43 additions and 21 deletions

View File

@@ -89,14 +89,14 @@ def register(app):
settings = notifications.getNotificationSettings(user_uuid)
if not settings:
return flask.jsonify({
"discord_webhook": "",
"discord_user_id": "",
"discord_enabled": False,
"ntfy_topic": "",
"ntfy_enabled": False,
"web_push_enabled": False,
}), 200
return flask.jsonify({
"discord_webhook": settings.get("discord_webhook") or "",
"discord_user_id": settings.get("discord_user_id") or "",
"discord_enabled": bool(settings.get("discord_enabled")),
"ntfy_topic": settings.get("ntfy_topic") or "",
"ntfy_enabled": bool(settings.get("ntfy_enabled")),