# -*- coding: utf-8 -*- 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='OC Bot - Character Management', 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 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' 'OK: https://example.com/avatar.png\n' 'NOT OK: Discord user profile link\n' 'NOT OK: Local file path', inline=False ) embed.add_field( name='Trigger', value='A short code (2-5 chars) that activates your character.\n' 'You will 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 am excited!` - Another message as them', inline=False ) embed.add_field( name='Trigger Rules', value='OK: 1-10 characters\n' 'OK: Lowercase letters (a-z)\n' 'OK: Numbers (0-9)\n' 'NOT OK: Reserved words (help, oc, ping, etc.)\n' 'NOT OK: 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 ) embed.set_footer(text='Coded by Ball Studios') 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 message will look', inline=False ) embed.set_footer(text='Coded by Ball Studios') 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 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' '- You will need to use new command immediately', inline=False ) embed.set_footer(text='Coded by Ball Studios') 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='Warning', value='This action cannot be undone!', inline=False ) embed.add_field( name='How to delete', value='1. `,oc delete Barny`\n' '2. Bot asks for confirmation\n' '3. Type YES (within 30 seconds)\n' '4. Character is permanently deleted', inline=False ) embed.set_footer(text='Coded by Ball Studios') await ctx.send(embed=embed) async def help_list(self, ctx): """Help for list command""" embed = discord.Embed( title='List Your Characters', color=discord.Color.blurple() ) embed.add_field( name='Command', value='`,oc list`', inline=False ) embed.add_field( name='What it shows', value='All your characters with their triggers', inline=False ) embed.add_field( name='Example output', value='Character 1: Barny (trigger: ba)\n' 'Character 2: Dragon (trigger: dr)\n' 'Character 3: Shy (trigger: sh)', inline=False ) embed.set_footer(text='Coded by Ball Studios') await ctx.send(embed=embed) async def help_info(self, ctx): """Help for info command""" embed = discord.Embed( title='Character Info', color=discord.Color.dark_blue() ) embed.add_field( name='Command', value='`,oc info `', inline=False ) embed.add_field( name='What it shows', value='Name, trigger, avatar URL, and description', inline=False ) embed.add_field( name='Example', value='`,oc info Barny`\n\n' 'Shows all details about your Barny character', inline=False ) embed.set_footer(text='Coded by Ball Studios') await ctx.send(embed=embed) async def help_preview(self, ctx): """Help for preview command""" embed = discord.Embed( title='Preview Character', color=discord.Color.teal() ) embed.add_field( name='Command', value='`,oc preview `', inline=False ) embed.add_field( name='What it does', value='Shows how a character message will appear', inline=False ) embed.add_field( name='Example', value='`,oc preview Barny`\n\n' 'Bot sends a sample message with Barny avatar and name', inline=False ) embed.set_footer(text='Coded by Ball Studios') 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))