updated cogs

This commit is contained in:
2026-06-17 12:51:39 -05:00
parent cfff3e7366
commit 910269e5b6
9 changed files with 414 additions and 34 deletions

View File

@@ -11,18 +11,22 @@ class OC(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name='oc')
async def oc_command(self, ctx):
"""Base OC command"""
await ctx.send('Use `,oc create`, `,oc list`, `,oc edit`, `,oc delete`, `,oc info`, or `,oc preview`\n\nType `,help oc` for more information.')
@commands.command(name='oc')
async def oc_create(self, ctx):
"""Start interactive character creation wizard"""
if ctx.invoked_subcommand is not None:
return
await ctx.send('Use `,oc create` to start the wizard.')
@commands.group(name='oc', invoke_without_command=True)
async def oc_group(self, ctx):
"""Original Character management commands"""
if ctx.invoked_subcommand is None:
embed = discord.Embed(
title='🎭 OC Commands',
description='Use `,oc <command>` for character management',
color=discord.Color.purple()
)
embed.add_field(name='`,oc create`', value='Create a new character', inline=False)
embed.add_field(name='`,oc list`', value='List your characters', inline=False)
embed.add_field(name='`,oc info <name>`', value='View character details', inline=False)
embed.add_field(name='`,oc edit <name>`', value='Edit a character', inline=False)
embed.add_field(name='`,oc delete <name>`', value='Delete a character', inline=False)
embed.add_field(name='`,oc preview <name>`', value='Preview character message', inline=False)
await ctx.send(embed=embed)
async def prompt_user(self, ctx, prompt_text, timeout=120):
"""Helper to get user input with timeout"""
@@ -36,10 +40,10 @@ class OC(commands.Cog):
)
return msg.content
except asyncio.TimeoutError:
await ctx.send('❌ Character creation cancelled (timeout).')
await ctx.send('❌ Cancelled (timeout).')
return None
@oc_create.command(name='create')
@oc_group.command(name='create')
async def create(self, ctx):
"""Interactive character creation"""
db = self.bot.db if hasattr(self.bot, 'db') else None
@@ -107,11 +111,12 @@ class OC(commands.Cog):
embed.add_field(name='Avatar', value=f'[Link]({avatar_url})', inline=False)
if description:
embed.add_field(name='Description', value=description, inline=False)
embed.set_footer(text='Use your trigger to send messages as this character!')
await ctx.send(embed=embed)
else:
await ctx.send('❌ Failed to create character.')
@oc_create.command(name='list')
@oc_group.command(name='list')
async def list_characters(self, ctx):
"""List all user's characters"""
db = self.bot.db if hasattr(self.bot, 'db') else None
@@ -139,7 +144,7 @@ class OC(commands.Cog):
await ctx.send(embed=embed)
@oc_create.command(name='info')
@oc_group.command(name='info')
async def info(self, ctx, *, character_name):
"""Show character information"""
db = self.bot.db if hasattr(self.bot, 'db') else None
@@ -173,7 +178,7 @@ class OC(commands.Cog):
await ctx.send(embed=embed)
@oc_create.command(name='edit')
@oc_group.command(name='edit')
async def edit(self, ctx, character_name=None):
"""Edit a character"""
db = self.bot.db if hasattr(self.bot, 'db') else None
@@ -290,7 +295,7 @@ class OC(commands.Cog):
else:
await ctx.send('❌ Failed to update character.')
@oc_create.command(name='delete')
@oc_group.command(name='delete')
async def delete(self, ctx, *, character_name):
"""Delete a character"""
db = self.bot.db if hasattr(self.bot, 'db') else None
@@ -330,7 +335,7 @@ class OC(commands.Cog):
else:
await ctx.send('❌ Failed to delete character.')
@oc_create.command(name='preview')
@oc_group.command(name='preview')
async def preview(self, ctx, *, character_name):
"""Preview how a character message will look"""
db = self.bot.db if hasattr(self.bot, 'db') else None