Refined command detection in bot.py