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
|
|
@ -12,6 +12,15 @@ class BaseModule(ABC):
|
|||
self.database = database
|
||||
self.game_engine = game_engine
|
||||
|
||||
@staticmethod
|
||||
def normalize_input(user_input):
|
||||
"""Normalize user input by converting to lowercase for case-insensitive command processing"""
|
||||
if isinstance(user_input, str):
|
||||
return user_input.lower()
|
||||
elif isinstance(user_input, list):
|
||||
return [item.lower() if isinstance(item, str) else item for item in user_input]
|
||||
return user_input
|
||||
|
||||
@abstractmethod
|
||||
def get_commands(self):
|
||||
"""Return list of commands this module handles"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue