fix: resolve Telegram command handler errors for /status and /positions (issue #74) #75
Reference in New Issue
Block a user
Delete Branch "feature/issue-74-telegram-command-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixed AttributeError exceptions in Telegram
/statusand/positionscommands that were causing handlers to crash.Changes Made
/statusCommand (src/main.py:621-653)risk.calculate_pnl(balance)call (method doesn't exist)output2structurerisk.circuit_breaker_threshold→risk._cb_threshold(correct private attribute)/positionsCommand (src/main.py:655-692)balance.stocksreferences (balance is dict, not object)Tests (tests/test_telegram_commands.py)
Testing
Unit Tests:
Live Bot Testing:
/statusand/positionscommands via TelegramRoot Cause
calculate_pnl()method - P&L calculation is in main.py_cb_threshold, not publiccircuit_breaker_thresholdbroker.get_balance()returns dict with nested structure, not object with.stocksattributeResolves
Closes #74
🤖 Generated with Claude Code