Skip to content

Fix Telegram Bot code quality issues - fixes #249#387

Merged
Scottcjn merged 1 commit intoScottcjn:mainfrom
zzjpython:fix-telegram-bot-code-quality
Feb 26, 2026
Merged

Fix Telegram Bot code quality issues - fixes #249#387
Scottcjn merged 1 commit intoScottcjn:mainfrom
zzjpython:fix-telegram-bot-code-quality

Conversation

@zzjpython
Copy link
Contributor

Description

This PR fixes the code quality issues identified in the bounty review for issue #249.

Changes Made:

  1. Removed duplicate file: Deleted tools/telegram_bot/bot.py which was a duplicate of telegram_bot.py.
  2. Implemented real /price command: Integrated DexScreener API to fetch real-time wRTC price data from Raydium, with Jupiter API fallback.
  3. Added environment variable support: Created .env.example file and added python-dotenv dependency for easy configuration.
  4. Improved error handling: Enhanced exception handling and logging throughout the codebase.
  5. Updated documentation: Comprehensive README.md with setup instructions, Docker deployment, and feature list.
  6. Fixed hardcoded values: Made API URL configurable via environment variable.

Testing:

  • Price command now fetches real data from DexScreener API
  • All other commands (miners, epoch, balance, health) remain functional
  • Environment variable configuration tested
  • Requirements updated with necessary dependencies

Deployment:

# 1. Set up environment
cp .env.example .env
# Edit .env with your TELEGRAM_BOT_TOKEN

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run bot
python telegram_bot.py

This addresses the owner feedback regarding:

  • Duplicate files
  • /price placeholder (now real API integration)
  • Hardcoded values
  • Code quality improvements

Ready for review and merge. This should qualify for the remaining 10 RTC bounty payment.

Resolves: #249

- Removed duplicate bot.py file
- Implemented real /price command using DexScreener API with Jupiter fallback
- Added environment variable support (.env.example file)
- Updated requirements.txt with python-dotenv dependency
- Improved error handling and logging
- Updated README.md with comprehensive setup instructions

Fixes issue Scottcjn#249 - addressing owner feedback on code quality.
@github-actions github-actions bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/L PR: 201-500 lines labels Feb 26, 2026
@Scottcjn Scottcjn merged commit 175452e into Scottcjn:main Feb 26, 2026
6 checks passed
@Scottcjn
Copy link
Owner

Payment confirmed — 10 RTC sent to wallet zzjpython for Telegram bot code quality fixes (duplicate removal, real DexScreener price integration, improved error handling).

Pending ID: 431, confirms in 24h.

This brings your total payout for the Telegram bot work to 25 RTC (15 RTC for PR #385 + 10 RTC for PR #387).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation size/L PR: 201-500 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants