import discord from discord.ext import commands class Help(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name='help', invoke_without_command=True) async def help_command(self, ctx, topic=None): """Show help information""" if not topic: return await self.show_main_help(ctx) topic = topic.lower() if topic == 'create': return await self.help_create(ctx) elif topic == 'list': return await self.help_list(ctx) elif topic == 'edit': return await self.help_edit(ctx) elif topic == 'delete': return await self.help_delete(ctx) elif topic == 'info': return await self.help_info(ctx) elif topic == 'preview': return await self.help_preview(ctx) elif topic == 'triggers': return await self.help_triggers(ctx) elif topic == 'oc': return await self.help_oc(ctx) else: await ctx.send('Unknown help topic. Use `,help` for available topics.') async def show_main_help(self, ctx): """Show main help menu""" embed = discord.Embed( title='🎭 Original Character Bot', description='Manage and roleplay as your original characters!', color=discord.Color.blue() ) embed.add_field( name='📚 What are OCs?', value='OCs (Original Characters) are fictional characters you create. This bot lets you manage them and send messages as them!', inline=False ) embed.add_field( name='🚀 Getting Started', value='`,oc create` - Start creating your first character!\n`,oc list` - View all your characters', inline=False ) embed.add_field( name='📖 Commands', value='**Character Management:**\n' '`,oc create` - Create a new character\n' '`,oc list` - List your characters\n' '`,oc info ` - View character details\n' '`,oc edit ` - Edit a character\n' '`,oc delete ` - Delete a character\n' '`,oc preview ` - Preview a character message\n\n' '**Help:**\n' '`,help` - Show this menu\n' '`,help ` - Show help for a specific topic', inline=False ) embed.add_field( name='💡 Quick Example', value='1. `,oc create` and follow the wizard\n' '2. Use `,ba Hello everyone` to send as your character\n' '3. `,oc list` to see all your characters', inline=False ) embed.add_field( name='📝 Help Topics', value='`,help create` - Character creation guide\n' '`,help triggers` - How triggers work\n' '`,help oc` - OC command overview\n' '`,help edit` - Editing guide\n' '`,help delete` - Deletion guide', inline=False ) embed.set_footer(text='Coded by Ball Studios 🎨') await ctx.send(embed=embed) async def help_create(self, ctx): """Help for character creation""" embed = discord.Embed( title='Character Creation Guide', color=discord.Color.green() ) embed.add_field( name='Command', value='`,oc create`', inline=False ) embed.add_field( name='What is it?', value='Starts an interactive wizard to create your first character.', inline=False ) embed.add_field( name='Step-by-step', value='1. Run `,oc create`\n' '2. Enter your character\'s name\n' '3. Provide an avatar URL (image link)\n' '4. Choose a unique trigger (e.g., `ba`, `sa`)\n' '5. Add an optional description\n' '6. Confirm!', inline=False ) embed.add_field( name='Avatar URL', value='This should be a direct link to an image:\n' '✅ `https://example.com/avatar.png`\n' '❌ Discord user profile link\n' '❌ Local file path', inline=False ) embed.add_field( name='Trigger', value='A short code (2-5 chars) that activates your character.\n' 'You\'ll use it like: `,ba Hello!`\n' 'Must be unique to you (others can have `,ba` too)', inline=False ) embed.add_field( name='Example', value='* Name: **Barny**\n' '* Avatar: `https://example.com/barny.png`\n' '* Trigger: `ba`\n' '* Final command: `,ba Hello everyone!`', inline=False ) embed.set_footer(text='Coded by Ball Studios 🎨') await ctx.send(embed=embed) async def help_triggers(self, ctx): """Help for trigger system""" embed = discord.Embed( title='Trigger System Guide', color=discord.Color.orange() ) embed.add_field( name='What is a trigger?', value='A trigger is a short code that activates your character when you use it with the comma prefix.', inline=False ) embed.add_field( name='How to use triggers', value='If your character has trigger `ba`:\n' '`,ba Hello!` → Message sent as your character\n' '`,ba I\'m excited!` → Another message as them', inline=False ) embed.add_field( name='Trigger Rules', value='✅ 1-10 characters\n' '✅ Lowercase letters (a-z)\n' '✅ Numbers (0-9)\n' '❌ Cannot be reserved words (help, oc, ping, etc.)\n' '❌ Must be unique to YOU (no duplicates per user)', inline=False ) embed.add_field( name='Multiple Users, Same Trigger', value='User A can have `,ba = Barny`\n' 'User B can have `,ba = Bob`\n' 'User C can have `,ba = Dragon`\n\n' 'Bot checks: Your ID + Trigger = Your character', inline=False ) embed.add_field( name='Reserved Triggers', value='These cannot be used as character triggers:\n' 'help, oc, ping, stats, invite, support, about,\n' 'reload, debug, admin, config', inline=False ) await ctx.send(embed=embed) async def help_oc(self, ctx): """Help for oc command""" embed = discord.Embed( title='OC Command Overview', color=discord.Color.purple() ) embed.add_field( name='`,oc create`', value='Start an interactive wizard to create a character', inline=False ) embed.add_field( name='`,oc list`', value='See all your characters and their triggers', inline=False ) embed.add_field( name='`,oc info `', value='View detailed information about a character', inline=False ) embed.add_field( name='`,oc edit `', value='Modify character details (name, avatar, trigger, description)', inline=False ) embed.add_field( name='`,oc delete `', value='Delete a character (requires confirmation)', inline=False ) embed.add_field( name='`,oc preview `', value='See how a character\'s message will look', inline=False ) await ctx.send(embed=embed) async def help_edit(self, ctx): """Help for editing""" embed = discord.Embed( title='Editing Characters', color=discord.Color.gold() ) embed.add_field( name='Command', value='`,oc edit `', inline=False ) embed.add_field( name='What can you edit?', value='• **Name** - Your character\'s name\n' '• **Avatar** - Their profile picture URL\n' '• **Trigger** - Their command code\n' '• **Description** - Background info', inline=False ) embed.add_field( name='How to edit', value='1. `,oc edit Barny`\n' '2. Choose what to edit (number 1-4)\n' '3. Provide new value\n' '4. Done!', inline=False ) embed.add_field( name='Trigger Change Tips', value='When changing a trigger:\n' '• Old trigger becomes unusable\n' '• New trigger must be unique\n' '• Use new trigger immediately\n' '• E.g., if `,ba` → `,bn`, use `,bn` now', inline=False ) await ctx.send(embed=embed) async def help_delete(self, ctx): """Help for deletion""" embed = discord.Embed( title='Deleting Characters', color=discord.Color.red() ) embed.add_field( name='Command', value='`,oc delete `', inline=False ) embed.add_field( name='What happens?', value='1. Bot asks for confirmation\n' '2. Type `YES` within 30 seconds\n' '3. Character is permanently deleted\n' '4. Trigger becomes available again', inline=False ) embed.add_field( name='⚠️ Warning', value='Deletion is **permanent**! You cannot undo this.\n' 'Create a backup/description if needed.', inline=False ) embed.add_field( name='Example', value='User: `,oc delete Barny`\n' 'Bot: Are you sure? Type YES to confirm.\n' 'User: `YES`\n' 'Bot: Character Barny deleted.', inline=False ) await ctx.send(embed=embed) async def help_list(self, ctx): """Help for listing characters""" embed = discord.Embed( title='Listing Your Characters', color=discord.Color.blue() ) embed.add_field( name='Command', value='`,oc list`', inline=False ) embed.add_field( name='What does it show?', value='A list of all your characters with their triggers', inline=False ) embed.add_field( name='Example Output', value='**Your Characters**\n' 'Barny\n' 'Trigger: `,ba`\n\n' 'Sarah\n' 'Trigger: `,sa`\n\n' 'Knight\n' 'Trigger: `,kn`', inline=False ) await ctx.send(embed=embed) async def help_info(self, ctx): """Help for info command""" embed = discord.Embed( title='Character Information', color=discord.Color.blurple() ) embed.add_field( name='Command', value='`,oc info `', inline=False ) embed.add_field( name='What does it show?', value='Detailed information about a character:\n' '• Name\n' '• Trigger code\n' '• Avatar image\n' '• Description\n' '• Creation date\n' '• Last time used', inline=False ) embed.add_field( name='Example', value='`,oc info Barny`', inline=False ) await ctx.send(embed=embed) async def help_preview(self, ctx): """Help for preview command""" embed = discord.Embed( title='Character Preview', color=discord.Color.green() ) embed.add_field( name='Command', value='`,oc preview `', inline=False ) embed.add_field( name='What does it do?', value='Shows you exactly how your character will appear when sending messages.\n' 'Useful to check:\n' '• Avatar displays correctly\n' '• Name looks good\n' '• Everything works as expected', inline=False ) embed.add_field( name='Example', value='`,oc preview Barny`\n\n' 'Bot sends a sample message with Barny\'s avatar and name', inline=False ) await ctx.send(embed=embed) async def setup(bot): # Remove default help command to avoid conflicts bot.remove_command('help') await bot.add_cog(Help(bot))