Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions templates/enhanced/ai-to-telegram-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ graph:
message: '${telegram_message}'
parse_mode: 'HTML'
disable_web_page_preview: true
error_handling: 'continue'
max_retries: 3
retry_delay: 2
timeout: 30
Expand All @@ -163,13 +164,32 @@ graph:

echo "🔍 Checking delivery status..."

telegram_success="${TELEGRAM_SUCCESS:-false}"
telegram_demo_mode="false"

if [ -z "${TELEGRAM_BOT_TOKEN:-}" ] || [ -z "${TELEGRAM_CHAT_ID:-}" ]; then
telegram_demo_mode="true"
fi
if [ "${TELEGRAM_BOT_TOKEN:-}" = "123456789:ABC-DEMO-TOKEN-REPLACE-WITH-REAL-BOT-TOKEN" ] \
|| [ "${TELEGRAM_CHAT_ID:-}" = "-1234567890" ]; then
telegram_demo_mode="true"
fi

# Check if TELEGRAM_SUCCESS variable exists and is true
if [ "${TELEGRAM_SUCCESS:-false}" = "true" ]; then
if [ "$telegram_success" = "true" ]; then
echo "✅ SUCCESS: Message delivered to Telegram!"
echo "📱 Chat ID: $TELEGRAM_CHAT_ID"
echo "📊 Content Type: ${content_type}"
echo "🎯 Topic: ${content_topic}"
echo "📝 Message Length: $(echo ${telegram_message} | wc -c) characters"
echo "📝 Message Length: $(printf '%s' "${telegram_message}" | wc -c) characters"
echo "Workflow completed successfully"
exit 0
fi

if [ "$telegram_demo_mode" = "true" ]; then
echo "⚠️ DEMO MODE: Telegram delivery skipped with missing or placeholder credentials"
echo "Workflow completed successfully"
exit 0
else
echo "❌ DELIVERY FAILED"
echo ""
Expand Down
Loading