misc(aurora): use redbot chat_formatting for errors and warnings
Some checks failed
Pylint / Pylint (3.11) (push) Failing after 41s
Some checks failed
Pylint / Pylint (3.11) (push) Failing after 41s
This commit is contained in:
parent
1f4254e9ca
commit
8129fee36a
4 changed files with 48 additions and 47 deletions
|
@ -7,6 +7,7 @@ from typing import Union
|
|||
from discord import Guild, Interaction, Member, User
|
||||
from discord.errors import Forbidden, NotFound
|
||||
from redbot.core import commands
|
||||
from redbot.core.utils.chat_formatting import error
|
||||
|
||||
from .config import config
|
||||
|
||||
|
@ -45,7 +46,7 @@ async def check_moddable(
|
|||
"""Checks if a moderator can moderate a target."""
|
||||
if check_permissions(interaction.client.user, permissions, guild=interaction.guild):
|
||||
await interaction.response.send_message(
|
||||
f"I do not have the `{permissions}` permission, required for this action.",
|
||||
error(f"I do not have the `{permissions}` permission, required for this action."),
|
||||
ephemeral=True,
|
||||
)
|
||||
return False
|
||||
|
@ -53,7 +54,7 @@ async def check_moddable(
|
|||
if await config.guild(interaction.guild).use_discord_permissions() is True:
|
||||
if check_permissions(interaction.user, permissions, guild=interaction.guild):
|
||||
await interaction.response.send_message(
|
||||
f"You do not have the `{permissions}` permission, required for this action.",
|
||||
error(f"You do not have the `{permissions}` permission, required for this action."),
|
||||
ephemeral=True,
|
||||
)
|
||||
return False
|
||||
|
@ -73,7 +74,7 @@ async def check_moddable(
|
|||
if isinstance(target, Member):
|
||||
if interaction.user.top_role <= target.top_role:
|
||||
await interaction.response.send_message(
|
||||
content="You cannot moderate members with a higher role than you!",
|
||||
content=error("You cannot moderate members with a higher role than you!"),
|
||||
ephemeral=True,
|
||||
)
|
||||
return False
|
||||
|
@ -83,7 +84,7 @@ async def check_moddable(
|
|||
<= target.top_role
|
||||
):
|
||||
await interaction.response.send_message(
|
||||
content="You cannot moderate members with a role higher than the bot!",
|
||||
content=error("You cannot moderate members with a role higher than the bot!"),
|
||||
ephemeral=True,
|
||||
)
|
||||
return False
|
||||
|
@ -93,7 +94,7 @@ async def check_moddable(
|
|||
for role in target.roles:
|
||||
if role.id in immune_roles:
|
||||
await interaction.response.send_message(
|
||||
content="You cannot moderate members with an immune role!",
|
||||
content=error("You cannot moderate members with an immune role!"),
|
||||
ephemeral=True,
|
||||
)
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue