Implement case-insensitive command processing across all bot modules
Added normalize_input() function to BaseModule for consistent lowercase conversion of user input. Updated all command modules to use normalization for commands, arguments, pet names, location names, gym names, and item names. Players can now use any capitalization for commands and arguments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
39ba55832d
commit
8e9ff2960f
8 changed files with 93 additions and 16 deletions
|
|
@ -64,7 +64,7 @@ class Exploration(BaseModule):
|
|||
return
|
||||
|
||||
# Handle various input formats and normalize location names
|
||||
destination_input = " ".join(args).lower()
|
||||
destination_input = self.normalize_input(" ".join(args))
|
||||
|
||||
# Map common variations to exact location names
|
||||
location_mappings = {
|
||||
|
|
@ -82,7 +82,7 @@ class Exploration(BaseModule):
|
|||
destination = location_mappings.get(destination_input)
|
||||
if not destination:
|
||||
# Fall back to title case if no mapping found
|
||||
destination = " ".join(args).title()
|
||||
destination = " ".join(self.normalize_input(args)).title()
|
||||
|
||||
location = await self.database.get_location_by_name(destination)
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ class Exploration(BaseModule):
|
|||
|
||||
if args:
|
||||
# Specific location requested
|
||||
location_name = " ".join(args).title()
|
||||
location_name = " ".join(self.normalize_input(args)).title()
|
||||
else:
|
||||
# Default to current location
|
||||
current_location = await self.database.get_player_location(player["id"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue