fix: remove /start command and handle @botname suffix
Some checks failed
CI / test (pull_request) Has been cancelled
Some checks failed
CI / test (pull_request) Has been cancelled
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>
This commit is contained in:
@@ -492,7 +492,8 @@ class TelegramCommandHandler:
|
||||
if not command_parts:
|
||||
return
|
||||
|
||||
command_name = command_parts[0]
|
||||
# Remove @botname suffix if present (for group chats)
|
||||
command_name = command_parts[0].split("@")[0]
|
||||
|
||||
# Execute handler
|
||||
handler = self._commands.get(command_name)
|
||||
|
||||
Reference in New Issue
Block a user