Skill: jesusreb/btc-price-monitor (version 1.0.0)

# BTC Price Monitor ## Description Fetches current Bitcoin price from CoinGecko and sends it to Telegram. Can also trigger alerts when price drops below a threshold. ## When to use - When user asks "what's the bitcoin price" - When user wants to check current BTC rate - When setting up price alerts ## Setup ### Required environment variables - `TELEGRAM_BOT_TOKEN`: Your Telegram bot token from @BotFather - `TELEGRAM_CHAT_ID`: Your Telegram chat ID (can get from @userinfobot) ### Optional environment variables - `PRICE_THRESHOLD_USD`: Set alert threshold (default: 50000). If price drops below this, an alert is added. ## Usage ### Basic usage ```bash python scripts/main.py ## Support **USDT (TRC20)**: [REDACTED_SECRET] **USDT (BEP20)**: [REDACTED_SECRET] **BTC**: [REDACTED_SECRET] **BNB (BSC)**: `0x5a03c0113fddce00fa7953b56541a16cab9a2800`

path: README.md
content: # BTC Price Monitor - OpenClaw Skill

Send Bitcoin price alerts to Telegram. Free, no API keys required.

## Features
- Real-time BTC price from CoinGecko
- Telegram notifications
- No API keys needed
- One-command setup

## Installation

### Install via ClawHub
```bash
clawhub install btc-price-monitor

## Support

If this skill helps you, consider supporting its development:

**USDT (TRC20)**: [REDACTED_SECRET]  
**USDT (BEP20)**: `0x5a03c0113fddce00fa7953b56541a16cab9a2800`  
**BTC**: [REDACTED_SECRET]  
**BNB (BSC)**: `0x5a03c0113fddce00fa7953b56541a16cab9a2800`

path: requirements.txt
content: requests==2.31.0

path: scripts/main.py
content: #!/usr/bin/env python3
"""
BTC Price Monitor for OpenClaw
Fetches Bitcoin price from CoinGecko and sends to Telegram
"""

import os
import requests
import sys
from datetime import datetime

# ==================================================
# CONFIGURATION - REPLACE WITH YOUR VALUES
# ==================================================

TELEGRAM_BOT_TOKEN = os.environ.get("TELEGRAM_BOT_TOKEN", "YOUR_BOT_TOKEN_HERE")
TELEGRAM_CHAT_ID = os.environ.get("TELEGRAM_CHAT_ID", "YOUR_CHAT_ID_HERE")
PRICE_THRESHOLD = float(os.environ.get("PRICE_THRESHOLD_USD", "50000"))

# ==================================================


def get_btc_price():
    """Fetch current BTC price from CoinGecko (free, no API key)"""
    try:
        url = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
        response = requests.get(url, timeout=10)
        data = response.json()
        return data["bitcoin"]["usd"]
    except Exception as e:
        return f"Error fetching price: {e}"


def send_telegram_message(message):
    """Send message to Telegram"""
    if TELEGRAM_BOT_TOKEN == "YOUR_BOT_TOKEN_HERE" or TELEGRAM_CHAT_ID == "YOUR_CHAT_ID_HERE":
        print("ERROR: Please set your TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID")
        return False

    url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
    payload = {
        "chat_id": TELEGRAM_CHAT_ID,
        "text": message,
        "parse_mode": "HTML"
    }

    try:
        response = requests.post(url, json=payload, timeout=10)
        return response.status_code == 200
    except Exception as e:
        print(f"Failed to send Telegram message: {e}")
        return False


def format_message(price, threshold=None):
    """Format price message with optional alert"""
    timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S UTC")

    message = "[BTC] Bitcoin Price Update\n\n"
    message += f"Price: ${price:,.0f}\n"
    message += f"Time: {timestamp}\n"

    if threshold and price < threshold:
        message += f"\nALERT: Price dropped below ${threshold:,.0f}!"

    return message


def main():
    """Main entry point"""
    price = get_btc_price()

    if isinstance(price, str) and "Error" in price:
        send_telegram_message(f"[ERROR] {price}")
        sys.exit(1)

    threshold = PRICE_THRESHOLD if PRICE_THRESHOLD != 50000 else None
    message = format_message(price, threshold)

    success = send_telegram_message(message)

    if success:
        print(f"Sent: BTC price ${price:,.0f}")
    else:
        print("Failed to send message")
        sys.exit(1)


if __name__ == "__main__":
    main()

Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)