fix: remove /start command and handle @botname suffix (issue #71) #72

Merged
jihoson merged 1 commits from fix/start-command-parsing into main 2026-02-05 17:15:14 +09:00
Collaborator

Issue

Closes #71

Problem 1: /start command name mismatch

  • Command name /start implies bot initialization
  • Actual function: shows help text (duplicate of /help)
  • Confusing and redundant

Problem 2: Group chat compatibility

  • Telegram sends commands as /command@botname in group chats
  • Command parser extracts command@botname as command name
  • Handler registered as command → no match → command fails

Solution

Remove /start command

  • Delete handle_start() function
  • Remove command registration
  • Remove from /help command list
  • Remove test case

Handle @botname suffix

# Before: command_name = command_parts[0]
# After:
command_name = command_parts[0].split("@")[0]

Now both formats work:

  • /helphelp (direct chat)
  • /help@mybothelp (group chat)

Changes

  • src/main.py: Remove handle_start, update registration
  • src/notifications/telegram_client.py: Add .split("@")[0]
  • tests/test_telegram_commands.py: Remove /start test, add @botname test

Result

  • 5 commands (was 6): /help, /status, /positions, /stop, /resume
  • Group chat support: Commands work with @botname suffix
  • No duplication: Single /help command for documentation

Test Plan

  • All tests pass (27/27)
  • /start removed from all code and tests
  • @botname suffix handling tested
  • No regression in existing commands

🤖 Generated with Claude Code

## Issue Closes #71 ### Problem 1: /start command name mismatch - Command name `/start` implies bot initialization - Actual function: shows help text (duplicate of `/help`) - Confusing and redundant ### Problem 2: Group chat compatibility - Telegram sends commands as `/command@botname` in group chats - Command parser extracts `command@botname` as command name - Handler registered as `command` → no match → command fails ## Solution ### Remove /start command - Delete `handle_start()` function - Remove command registration - Remove from `/help` command list - Remove test case ### Handle @botname suffix ```python # Before: command_name = command_parts[0] # After: command_name = command_parts[0].split("@")[0] ``` Now both formats work: - `/help` → `help` (direct chat) - `/help@mybot` → `help` (group chat) ## Changes - `src/main.py`: Remove handle_start, update registration - `src/notifications/telegram_client.py`: Add .split("@")[0] - `tests/test_telegram_commands.py`: Remove /start test, add @botname test ## Result - **5 commands** (was 6): /help, /status, /positions, /stop, /resume - **Group chat support**: Commands work with @botname suffix - **No duplication**: Single /help command for documentation ## Test Plan - [x] All tests pass (27/27) - [x] /start removed from all code and tests - [x] @botname suffix handling tested - [x] No regression in existing commands 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-05 16:10:00 +09:00
fix: remove /start command and handle @botname suffix
Some checks failed
CI / test (pull_request) Has been cancelled
1c5eadc23b
Remove /start command as name doesn't match functionality, and fix
command parsing to handle @botname suffix for group chat compatibility.

Changes:
- Remove handle_start function and registration
- Remove /start from help command list
- Remove test_start_command_content test
- Strip @botname suffix from commands (e.g., /help@mybot → help)

Rationale:
- /start command name implies bot initialization, but it was just
  showing help text (duplicate of /help)
- Better to have one clear /help command
- @botname suffix handling needed for group chats

Test:
- 27 tests pass (1 removed, 1 added for @botname handling)
- All existing functionality preserved

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
jihoson merged commit d2b07326ed into main 2026-02-05 17:15:14 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#72