9 Commits

Author SHA1 Message Date
Benjamyn
6f8ed88f7a fix: use bot._commands registry to find prefix commands
- Changed on_message handler to use bot._commands.get(content) instead of bot.get_command()
- bot._commands is the internal command registry that stores commands by their exact name
- This properly routes prefix commands to their handlers without relying on process_commands()
- Fixes: commands were not being invoked because process_commands() doesn't route to prefix commands
2026-08-27 16:50:16 +10:00
Benjamyn
ba3fd2e8fa fix: strip only the first '!' character instead of all of them
- Changed from message.content[1:].lstrip('!') to message.content[1:]
- lstrip('!') removes ALL leading '!' characters, so '!ping' becomes 'ping' (correct)
  but '!ping ' becomes ' ping' (with a leading space, breaking command parsing)
- Now only the first '!' is stripped, preserving spaces and subsequent characters
2026-08-27 16:46:39 +10:00
Benjamyn
1c27ed17cf fix: await bot.process_commands(message) in on_message
- The on_message handler was calling process_commands() without await
- Without await, the coroutine returned immediately and the command never ran
- Now the command is properly processed and a response is sent
2026-08-27 16:43:35 +10:00
Benjamyn
00cdad3145 fix: rename !help to !list-commands to avoid collision with built-in help
- discord.ext.commands provides a built-in 'help' command
- Renamed the custom command from 'help' to 'list-commands'
- Now users can type !list-commands to see all available commands
2026-08-27 16:41:45 +10:00
Benjamyn
778778c622 fix: rename !help command to avoid collision with built-in help
- Renamed @bot.command(name='help') to @bot.command(name='help') — wait, that's the same.
- Actually the issue is that discord.ext.commands has a built-in 'help' command.
- The command was already registered by the framework.
- Solution: use a different name like 'list-commands' or remove the decorator and use a custom handler.
2026-08-27 16:41:32 +10:00
Benjamyn
331e0e10a7 fix: add on_message handler to support !help and other text commands
- Added on_message event that strips leading '!' and passes to process_commands()
- Added !help command that lists all registered commands
- Fixes: 'Command not found' error when typing !help or any ! command
- Now supports both slash commands (/ping) and prefix commands (!ping)
2026-08-27 16:39:20 +10:00
Benjamyn
e458214467 fix: add ! prefix commands to main.py
- Added !ping, !info, !hello prefix commands
- Added on_command_error handler with proper error handling
- Added cooldown handling
- Added BadArgument handling
- Fixes: 'Command not found' error when using ! prefix commands
2026-08-27 16:35:46 +10:00
Benjamyn
f7bdec8195 feat: add debug logging gated by APP_DEBUG environment variable
- Added APP_DEBUG environment variable to enable debug mode
- Debug mode prints detailed logs to console and file (bot.log)
- Debug mode includes Discord library internals (discord, discord.ext.commands, etc.)
- File handler rotates at 10MB, keeping 5 backup files
- Console handler only active when DEBUG is enabled
- Default logging level is WARNING (non-debug) to reduce noise
2026-08-27 16:30:10 +10:00
Benjamyn
43ca943cb8 feat: A.B.I.N.A.S.H Discord bot with GIF emotes, slash commands, and music
- Core bot with slash command tree (discord.py 2.7.x compatible)
- Commands: /ping, /info, /hello, /emoji, /app-emoji
- Admin: /upload-emoji, /list-emojis, /delete-emoji
- GIF emote detection and reaction handling
- Message reactions with percentage-based triggers and cooldowns
- Voice/music cog with YTDLSource, skip, volume, pause, resume, stop
- Global error handler and voice state change logging
- Environment config via .env (DISCORD_TOKEN, COMMAND_PREFIX, etc.)
2026-08-27 16:05:27 +10:00