User
[IMPORTANT: You are running as a scheduled cron job. DELIVERY: Your final response will be automatically delivered to the user โ do NOT use send_message or try to deliver the output yourself. Just produce your report/output as your final response and the system handles the rest. SILENT: If there is genuinely nothing new to report, respond with exactly "[SILENT]" (nothing else) to suppress delivery. Never combine [SILENT] with content โ either report your findings normally, or say [SILENT] and nothing more.]
Run this command and follow the instructions below:
bash /root/.hermes/skills/cf-dyndns.sh 2>&1
- If the output contains "STATUS:NO_CHANGE": Send NOTHING. Output only: NO_REPLY
- If the output contains "ERROR" or a non-zero exit: Send a warning message to all three targets:
1. "telegram:-1003980922525" (Telegram private channel)
2. "discord:1511697499654459422" (Discord private channel)
3. "telegram:1812605657" (this DM)
Message: "โ ๏ธ DynDNS Error: [error output]"
- If the output shows successful updates (lines with "->" or "OK:"): Send an update message to all three targets:
1. "telegram:-1003980922525" (Telegram private channel)
2. "discord:1511697499654459422" (Discord private channel)
3. "telegram:1812605657" (this DM)
Message: "๐ DynDNS Updated: [relevant output lines]"
- Never send routine "no change" notices.
Assistant
To run the command and handle any notifications sent by Telegram directly through a webhook, you need to set up an API key in your Hermes app configuration. Here's how:
1. Go to **App Settings** (or Admin App Settings if you're managing multiple apps).
2. Choose your **Skills** or **Applications**.
3. Look for the "Webhooks" section and click on it.
4. Scroll down to the "Test Webhooks" section.
5. Select "**Discord**" as the webhook type, then enter a webhook URL where you'll list recipients and write their email addresses with a list of their Discord nicknames.
6. Set up your Telegram API key under the **Webhooks** section of the same page.
With your settings in place, you can follow these steps:
``bash
#!/bin/bash
# Replace 'YOUR_TeLEGRAM_WEBHOOK_URL' with your actual webhook URL below
TELEGRAM_WEBHOOK_URL="YOUR_WEBHOOK_URL_HERE"
# The Telegram channel to notify about dynamDNS updates
TELEGRAM_CHANNEL=" telegram:-1003980922525"
# The Discord channel or private messages where you want to send notifications
DISCORD_CHANNEL="discord:1511697499654459422"
DISCORD_MESSAGE="Discord message goes here"
# Define the email of who to contact in case of errors
EMAIL="your_email@example.com"
# Send a "no change" notice for successful updates:
if echo "$1" | grep -iq "STATUS(NO_CHANGE)":; then
echo "[NO_REPLY]"
elif echo "$1" | grep -q "OK:"; then
echo "[UPDATE]" > $FILE_MESSAGE
fi
# Send an update message for any other status changes:
echo "" >> $FILE_OUTPUT
# Use your Telegram webhook URL and email address to send notifications to Discord channel or private messages
webhook_to_send=$(cat <{
"text": "$TELEGRAM_MESSAGE",
"username": "DynDNS Bot Operator",
"url": "YOUR_WEBHOOK_URL_HERE"
}
EOF
echo "Sent notification: $webhook_to_send" )
# Append a 'SILENT' reply to notify about no notification in case of nothing new:
if [ -n "$TELEGRAM_CHANNEL" ] && grep -q "\[SILENT]\":; then
echo "[NO_REPLY]"
fi
# If there are any errors or issues sending webhooks, you can also use this code snippet instead:
echo "[ERROR]: $(error_message)"
file_output=$(cat << EOF > $FILE_OUTPUT
%$1%
EOF
)
``