2 Commits

Author SHA1 Message Date
neo
842416a915 fix: channel id for melonx 2026-05-09 12:28:44 -04:00
neoarz
cad8995324 fix: permission checking 2026-04-14 16:34:03 -04:00
4 changed files with 61 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ BAIT_CONFIGS = {
"melonx": {
"guild_id": 1300369899704680479,
"channel_ids": [
1434327970679492830,
1502657024926941345,
],
"protected_role_id": 1300372178138697758,
"log_channel_id": 1300374786471366696,

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 = []

View File

@@ -23,6 +23,33 @@ def hackban_command():
:param reason: The reason for the ban. Default is "Not specified".
"""
try:
if (
not context.author.guild_permissions.ban_members
and context.author != context.guild.owner
):
embed = discord.Embed(
title="Missing Permissions!",
description="You don't have the `Ban Members` permission to use 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
if not context.guild.me.guild_permissions.ban_members:
embed = discord.Embed(
title="Missing Permissions!",
description="I am missing the permission(s) `ban_members` 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
await self.bot.http.ban(user_id, context.guild.id, reason=reason)
user = self.bot.get_user(int(user_id)) or await self.bot.fetch_user(
int(user_id)

View File

@@ -15,6 +15,28 @@ def purge_command():
user="The user whose messages should be deleted (optional).",
)
async def purge(self, context, amount: int, user: discord.Member = None):
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
if not context.guild.me.guild_permissions.manage_messages:
embed = discord.Embed(
title="Missing Permissions!",
description="I am 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
if context.interaction:
await context.defer(ephemeral=True)