Skip to content

HuiNeng6/rustchain-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

RustChain Telegram Bot

Telegram bot for checking RustChain wallet balance and miner status.

Bounty #2869 - 10 RTC

Commands

Command Description
/balance <wallet> Check RTC balance
/miners List active miners
/epoch Current epoch info
/price Show RTC reference rate ($0.10)
/help Show commands

Quick Start

1. Get Telegram Bot Token

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow instructions
  3. Copy the bot token

2. Install Dependencies

pip install -r requirements.txt

3. Run Bot

export TELEGRAM_BOT_TOKEN="your_token_here"
python bot.py

Deployment Options

Option A: Railway (Recommended)

  1. Create account at railway.app
  2. Create new project → Deploy from GitHub
  3. Add environment variable: TELEGRAM_BOT_TOKEN
  4. Railway auto-deploys on push

Option B: Fly.io

  1. Install flyctl: curl -L https://fly.io/install.sh | sh
  2. Login: fly auth login
  3. Launch: fly launch
  4. Set secret: fly secrets set TELEGRAM_BOT_TOKEN=your_token

Option C: systemd (Linux VPS)

Create /etc/systemd/system/rustchain-bot.service:

[Unit]
Description=RustChain Telegram Bot
After=network.target

[Service]
Type=simple
User=bot
WorkingDirectory=/opt/rustchain-bot
Environment=TELEGRAM_BOT_TOKEN=your_token
ExecStart=/usr/bin/python3 bot.py
Restart=always

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl enable rustchain-bot
sudo systemctl start rustchain-bot

Features

  • Rate limiting: 1 request per 5 seconds per user
  • Error handling: Graceful handling when RustChain node is offline
  • Balance check: Shows RTC balance with USD equivalent
  • Miner list: Shows active miners and their multipliers
  • Epoch info: Current epoch timing

API Integration

Bot uses RustChain public API at https://rustchain.org/api:

  • /balance/{wallet} - Get wallet balance
  • /miners - List active miners
  • /epoch - Get epoch info

License

MIT

Bounty Claim

About

Telegram bot for checking RustChain wallet balance and miner status

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages