fix: permission checking

This commit is contained in:
neoarz
2026-04-14 16:34:03 -04:00
parent 70c21cdc0d
commit cad8995324
3 changed files with 60 additions and 0 deletions

View File

@@ -21,6 +21,17 @@ def archive_command():
:param context: The hybrid command context.
:param limit: The limit of messages that should be archived. Default is 10.
"""
if not context.author.guild_permissions.manage_messages:
embed = discord.Embed(
title="Missing Permissions!",
description="You are missing the permission(s) `manage_messages` to execute this command!",
color=0xE02B2B,
).set_author(
name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png"
)
await context.send(embed=embed, ephemeral=True)
return
log_file = f"{context.channel.id}.log"
messages = []