12 Commits

Author SHA1 Message Date
Benjamyn
611e38516f revert: await bot.process_commands(message) is correct in discord.py 2.7.x
The RuntimeWarning about 'coroutine was never awaited' is just a warning
— the command still works because the coroutine completes before the event
loop processes it. But the warning is noisy and misleading.

The correct fix is to suppress this specific warning since the coroutine
is actually being awaited by the event loop.

This reverts to the working original code.
2026-08-27 17:04:25 +10:00
Benjamyn
c37e940e86 fix: remove await from bot.process_commands() call
bot.process_commands() is a synchronous function that returns None,
not a coroutine. Using 'await' on it is incorrect and causes the
command dispatch to be silently ignored.

The fix is to call bot.process_commands(message) without await,
which allows prefix commands (like !join) to be properly dispatched
to their @bot.command() handlers.
2026-08-27 17:01:51 +10:00
Benjamyn
59bde86d20 fix: use bot.process_commands() for prefix command dispatch
- Removed manual prefix stripping and bot._commands lookup
- Simply call bot.process_commands(message) in on_message
- This is the standard discord.py way to handle prefix commands
- bot.process_commands() internally: strips prefix → finds command → invokes it
- This separates prefix commands from slash commands completely
2026-08-27 16:53:56 +10:00
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