#!/bin/bash

echo "=== Testing Telegram Bot View Changes ==="
echo ""
echo "This test will verify that Telegram commands change the CLI view"
echo ""
echo "Instructions:"
echo "1. Run 'svs status' in one terminal"
echo "2. Send 'v' to your Telegram bot - the CLI should show validator status view"
echo "3. Send 'sd' to your Telegram bot - the CLI should switch to dry-run view"
echo "4. Send 's' or 'switch' to your Telegram bot - executes REAL switch (NO UI change!)"
echo "5. Views automatically return to status view after timeout (10s for dry-run)"
echo "6. You can also use keyboard shortcuts in the CLI:"
echo "   - 'v' for validator status"
echo "   - 'd' for dry-run switch"
echo "   - Note: 's' keyboard shortcut removed to prevent accidental switches"
echo ""
echo "Make sure you have:"
echo "- Configured telegram bot in config.yaml"
echo "- Started svs status command"
echo ""
echo "Press Enter to see the config format needed..."
read

echo "Your config.yaml should include:"
echo ""
echo "alert_config:"
echo "  enabled: true"
echo "  delinquency_threshold_seconds: 30"
echo "  telegram:"
echo "    bot_token: \"YOUR_BOT_TOKEN\""
echo "    chat_id: \"YOUR_CHAT_ID\""
echo ""
echo "To get your chat_id:"
echo "1. Send a message to your bot"
echo "2. Visit: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates"
echo "3. Look for the 'chat' object and find the 'id' field"