Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[admin] correctly log blacklist add and removes #513

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions ballsdex/packages/admin/blacklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ async def blacklist_add(
else:
interaction.client.blacklist.add(user.id)
await interaction.response.send_message("User is now blacklisted.", ephemeral=True)
await log_action(
f"{interaction.user} blacklisted {user} ({user.id})"
f" for the following reason: {reason}.",
interaction.client,
)
await log_action(
f"{interaction.user} blacklisted {user} ({user.id})"
f" for the following reason: {reason}.",
interaction.client,
)

@app_commands.command(name="remove")
@app_commands.checks.has_any_role(*settings.root_role_ids, *settings.admin_role_ids)
Expand Down Expand Up @@ -94,10 +94,11 @@ async def blacklist_remove(
await interaction.response.send_message(
"User is now removed from blacklist.", ephemeral=True
)
await log_action(
f"{interaction.user} removed blacklist for user {user} ({user.id}).\nReason: {reason}",
interaction.client,
)
await log_action(
f"{interaction.user} removed blacklist for user {user} ({user.id})."
f"\nReason: {reason}",
interaction.client,
)

@app_commands.command(name="info")
async def blacklist_info(
Expand Down Expand Up @@ -225,11 +226,11 @@ async def blacklist_add_guild(
else:
interaction.client.blacklist_guild.add(guild.id)
await interaction.response.send_message("Guild is now blacklisted.", ephemeral=True)
await log_action(
f"{interaction.user} blacklisted the guild {guild}({guild.id}) "
f"for the following reason: {reason}.",
interaction.client,
)
await log_action(
f"{interaction.user} blacklisted the guild {guild}({guild.id}) "
f"for the following reason: {reason}.",
interaction.client,
)

@app_commands.command(name="remove")
@app_commands.checks.has_any_role(*settings.root_role_ids, *settings.admin_role_ids)
Expand Down
Loading