added options to the discord bot

This commit is contained in:
2025-10-20 02:50:02 +02:00
parent 2fb5f48a54
commit 1cdcf2f423

View File

@@ -7,6 +7,8 @@ ntfy_password = os.getenv('ntfy_password')
ntfy_host = os.getenv('ntfy_host') ntfy_host = os.getenv('ntfy_host')
ntfy_topic = os.getenv('ntfy_topic') ntfy_topic = os.getenv('ntfy_topic')
dc_webhook = os.getenv('dc_webhook') dc_webhook = os.getenv('dc_webhook')
dc_botname = os.getenv('dc_botname')
dc_avatar_url = os.getenv('dc_avatar_url')
from argparse import ArgumentParser from argparse import ArgumentParser
import apprise import apprise
@@ -27,7 +29,7 @@ if ntfy_host and ntfy_topic:
ntfy_link = ntfy_link + "?click=" + args.click ntfy_link = ntfy_link + "?click=" + args.click
apobj.add(ntfy_link) apobj.add(ntfy_link)
if dc_webhook: if dc_webhook:
apobj.add(f"https://discord.com/api/webhooks/{dc_webhook}"); apobj.add(f"discord://{dc_webhook}?avatar_url={dc_avatar_url}&botname={dc_botname}");
apobj.notify( apobj.notify(
body=args.body, body=args.body,