first commit

This commit is contained in:
2026-04-29 17:41:10 -05:00
parent f53104d947
commit 0fe6bd7ea6
15 changed files with 1678 additions and 33 deletions

View File

@@ -0,0 +1,40 @@
"""
prefix_command_registry.py - Module registration for prefix commands
Same pattern as command_registry.py, but for !command-style handlers
in the command text channel. No AI, no session, no auth.
Handler signature: async def handler(message, args) -> None
message: discord.Message object
args: list of strings (everything after the command name)
"""
PREFIX_COMMANDS = {}
def register_prefix_command(name, handler):
"""
Register a handler for a prefix command.
Args:
name: String key (e.g., 'play', 'skip', 'queue')
handler: Async function(message, args) -> None
Example:
async def handle_play(message, args):
query = " ".join(args)
# ... search YouTube, join voice, play ...
register_prefix_command('play', handle_play)
"""
PREFIX_COMMANDS[name] = handler
def get_prefix_handler(name):
"""Get the registered handler for a prefix command name."""
return PREFIX_COMMANDS.get(name)
def list_prefix_commands():
"""List all registered prefix command names."""
return list(PREFIX_COMMANDS.keys())