Implement slash command synchronization features in environment files and update command definitions to hybrid commands across various cogs. Enhance command registration for improved user experience and streamline command handling in the bot.
This commit is contained in:
@@ -136,7 +136,7 @@ class Tracking(commands.Cog):
|
||||
row = await cursor.fetchone()
|
||||
return row[0] if row else 0
|
||||
|
||||
@commands.command(aliases=["inv"])
|
||||
@commands.hybrid_command(aliases=["inv"])
|
||||
async def invites(self, ctx, member: discord.Member = None):
|
||||
member = member or ctx.author
|
||||
await self.ensure_tables(ctx.guild.id)
|
||||
@@ -161,7 +161,7 @@ class Tracking(commands.Cog):
|
||||
)
|
||||
await ctx.send(view=CV2(f"Invite Log - {member.name}", desc))
|
||||
|
||||
@commands.command(aliases=["addinvs"])
|
||||
@commands.hybrid_command(aliases=["addinvs"])
|
||||
@commands.has_permissions(administrator=True)
|
||||
async def addinvites(self, ctx, member: discord.Member, amount: int):
|
||||
await self.ensure_tables(ctx.guild.id)
|
||||
@@ -171,7 +171,7 @@ class Tracking(commands.Cog):
|
||||
await db.commit()
|
||||
await ctx.send(view=CV2("✅ Success", f"Added **{amount}** invites to {member.mention}."))
|
||||
|
||||
@commands.command(aliases=["setinvs"])
|
||||
@commands.hybrid_command(aliases=["setinvs"])
|
||||
@commands.has_permissions(administrator=True)
|
||||
async def setinvites(self, ctx, member: discord.Member, amount: int):
|
||||
await self.ensure_tables(ctx.guild.id)
|
||||
@@ -180,7 +180,7 @@ class Tracking(commands.Cog):
|
||||
await db.commit()
|
||||
await ctx.send(view=CV2("✅ Success", f"Set invites of {member.mention} to **{amount}**."))
|
||||
|
||||
@commands.command(aliases=["resetinvs"])
|
||||
@commands.hybrid_command(aliases=["resetinvs"])
|
||||
@commands.has_permissions(administrator=True)
|
||||
async def resetinvites(self, ctx, member: discord.Member):
|
||||
await self.ensure_tables(ctx.guild.id)
|
||||
@@ -189,7 +189,7 @@ class Tracking(commands.Cog):
|
||||
await db.commit()
|
||||
await ctx.send(view=CV2("✅ Success", f"Reset invites of {member.mention}."))
|
||||
|
||||
@commands.command(aliases=["invlb"])
|
||||
@commands.hybrid_command(aliases=["invlb"])
|
||||
async def invitesleaderboard(self, ctx):
|
||||
await self.ensure_tables(ctx.guild.id)
|
||||
async with aiosqlite.connect(INVITE_DB) as db:
|
||||
@@ -208,7 +208,7 @@ class Tracking(commands.Cog):
|
||||
|
||||
await ctx.send(view=CV2("📊 Invite Leaderboard", leaderboard))
|
||||
|
||||
@commands.command(aliases=["invlog"])
|
||||
@commands.hybrid_command(aliases=["invlog"])
|
||||
@commands.has_permissions(administrator=True)
|
||||
async def invitelogging(self, ctx, channel: discord.TextChannel):
|
||||
await self.ensure_tables(ctx.guild.id)
|
||||
|
||||
Reference in New Issue
Block a user