fix: Replace hybrid_command with command for leveling commands to standardize command handling
This commit is contained in:
parent
66fad3a41b
commit
161975731c
@ -382,7 +382,7 @@ class LevelingCog(commands.Cog):
|
||||
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
@level.hybrid_command(name="leaderboard", description="Show the server's level leaderboard")
|
||||
@level.command(name="leaderboard", description="Show the server's level leaderboard")
|
||||
async def leaderboard_command(self, ctx: commands.Context):
|
||||
"""Show the server's level leaderboard"""
|
||||
if not ctx.guild:
|
||||
@ -418,7 +418,7 @@ class LevelingCog(commands.Cog):
|
||||
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
@level.hybrid_command(name="register_role", description="Register a role for a specific level")
|
||||
@level.command(name="register_role", description="Register a role for a specific level")
|
||||
@commands.has_permissions(manage_roles=True)
|
||||
async def register_level_role(self, ctx: commands.Context, level: int, role: discord.Role):
|
||||
"""Register a role to be assigned at a specific level"""
|
||||
@ -440,7 +440,7 @@ class LevelingCog(commands.Cog):
|
||||
|
||||
await ctx.send(f"✅ Role {role.mention} will now be assigned at level {level}.")
|
||||
|
||||
@level.hybrid_command(name="remove_role", description="Remove a level role registration")
|
||||
@level.command(name="remove_role", description="Remove a level role registration")
|
||||
@commands.has_permissions(manage_roles=True)
|
||||
async def remove_level_role(self, ctx: commands.Context, level: int):
|
||||
"""Remove a level role registration"""
|
||||
@ -458,7 +458,7 @@ class LevelingCog(commands.Cog):
|
||||
|
||||
await ctx.send(f"✅ Level {level} role registration has been removed.")
|
||||
|
||||
@level.hybrid_command(name="list_roles", description="List all registered level roles")
|
||||
@level.command(name="list_roles", description="List all registered level roles")
|
||||
async def list_level_roles(self, ctx: commands.Context):
|
||||
"""List all registered level roles for this server"""
|
||||
if not ctx.guild:
|
||||
@ -488,7 +488,7 @@ class LevelingCog(commands.Cog):
|
||||
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
@level.hybrid_command(name="restrict_channel", description="Restrict a channel from giving XP")
|
||||
@level.command(name="restrict_channel", description="Restrict a channel from giving XP")
|
||||
@commands.has_permissions(manage_channels=True)
|
||||
async def restrict_channel(self, ctx: commands.Context, channel: discord.TextChannel = None):
|
||||
"""Restrict a channel from giving XP"""
|
||||
@ -502,7 +502,7 @@ class LevelingCog(commands.Cog):
|
||||
self.save_restricted_channels()
|
||||
await ctx.send(f"✅ {target_channel.mention} will no longer give XP for messages.")
|
||||
|
||||
@level.hybrid_command(name="unrestrict_channel", description="Allow a channel to give XP again")
|
||||
@level.command(name="unrestrict_channel", description="Allow a channel to give XP again")
|
||||
@commands.has_permissions(manage_channels=True)
|
||||
async def unrestrict_channel(self, ctx: commands.Context, channel: discord.TextChannel = None):
|
||||
"""Allow a channel to give XP again"""
|
||||
@ -516,7 +516,7 @@ class LevelingCog(commands.Cog):
|
||||
self.save_restricted_channels()
|
||||
await ctx.send(f"✅ {target_channel.mention} will now give XP for messages.")
|
||||
|
||||
@level.hybrid_command(name="process_messages", description="Process existing messages to award XP")
|
||||
@level.command(name="process_messages", description="Process existing messages to award XP")
|
||||
@commands.is_owner()
|
||||
async def process_existing_messages(self, ctx: commands.Context, limit: int = 10000):
|
||||
"""Process existing messages to award XP (Owner only)"""
|
||||
@ -632,7 +632,7 @@ class LevelingCog(commands.Cog):
|
||||
self.save_config()
|
||||
print(f'{self.__class__.__name__} cog has been unloaded and data saved.')
|
||||
|
||||
@level.hybrid_command(name="config", description="Configure XP settings")
|
||||
@level.command(name="config", description="Configure XP settings")
|
||||
@commands.has_permissions(administrator=True)
|
||||
async def xp_config(self, ctx: commands.Context, setting: str = None, value: str = None):
|
||||
"""Configure XP settings for the leveling system"""
|
||||
@ -722,7 +722,7 @@ class LevelingCog(commands.Cog):
|
||||
# Save the updated configuration
|
||||
self.save_config()
|
||||
|
||||
@level.hybrid_command(name="toggle_notifs", description="Toggle level-up notifications for yourself")
|
||||
@level.command(name="toggle_notifs", description="Toggle level-up notifications for yourself")
|
||||
async def toggle_level_notifs(self, ctx: commands.Context):
|
||||
"""Toggle level-up notifications for yourself"""
|
||||
user_data = self.get_user_data(ctx.author.id)
|
||||
@ -734,7 +734,7 @@ class LevelingCog(commands.Cog):
|
||||
status_text = "enabled" if new_status else "disabled"
|
||||
await ctx.send(f"✅ Level-up notifications have been **{status_text}** for you.")
|
||||
|
||||
@level.hybrid_command(name="setup_medieval_roles", description="Set up medieval-themed level roles")
|
||||
@level.command(name="setup_medieval_roles", description="Set up medieval-themed level roles")
|
||||
@commands.has_permissions(manage_roles=True)
|
||||
async def setup_medieval_roles(self, ctx: commands.Context):
|
||||
"""Automatically set up medieval-themed level roles with gender customization"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user