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:
@@ -21,7 +21,7 @@ class Messagespack(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@commands.command(name="addmessages", aliases=["addmsg"])
|
||||
@commands.hybrid_command(name="addmessages", aliases=["addmsg"])
|
||||
@commands.has_permissions(manage_messages=True)
|
||||
async def addmessages(self, ctx, member: discord.Member, amount: int):
|
||||
if amount <= 0:
|
||||
@@ -46,7 +46,7 @@ class Messagespack(commands.Cog):
|
||||
conn.close()
|
||||
await ctx.send(f"Added {amount} messages to {member.mention} for today.")
|
||||
|
||||
@commands.command(name="removemessages", aliases=["removemsg"])
|
||||
@commands.hybrid_command(name="removemessages", aliases=["removemsg"])
|
||||
@commands.has_permissions(manage_messages=True)
|
||||
async def removemessages(self, ctx, member: discord.Member, amount: int):
|
||||
if amount <= 0:
|
||||
@@ -70,7 +70,7 @@ class Messagespack(commands.Cog):
|
||||
await ctx.send(f"{member.mention} has no messages recorded for today.")
|
||||
conn.close()
|
||||
|
||||
@commands.command(name="clearmessage", aliases=["clearmsg"])
|
||||
@commands.hybrid_command(name="clearmessage", aliases=["clearmsg"])
|
||||
@commands.has_permissions(manage_messages=True)
|
||||
async def clearmessage(self, ctx, member: discord.Member):
|
||||
conn = sqlite3.connect(db_path("messages.db"))
|
||||
|
||||
Reference in New Issue
Block a user