mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 11:40:12 +01:00
chore: ruff formatting
This commit is contained in:
@@ -13,9 +13,7 @@ def nick_command():
|
||||
user="The user that should have a new nickname.",
|
||||
nickname="The new nickname that should be set.",
|
||||
)
|
||||
async def nick(
|
||||
self, context, user: discord.User, *, nickname: str = None
|
||||
):
|
||||
async def nick(self, context, user: discord.User, *, nickname: str = None):
|
||||
"""
|
||||
Change the nickname of a user on a server.
|
||||
|
||||
@@ -28,15 +26,19 @@ def nick_command():
|
||||
title="Missing Permissions!",
|
||||
description="You are missing the permission(s) `manage_nicknames` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
).set_author(
|
||||
name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png"
|
||||
)
|
||||
return await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
|
||||
if not context.guild.me.guild_permissions.manage_nicknames:
|
||||
embed = discord.Embed(
|
||||
title="Missing Permissions!",
|
||||
description="I am missing the permission(s) `manage_nicknames` to execute this command!",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
).set_author(
|
||||
name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png"
|
||||
)
|
||||
return await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
member = context.guild.get_member(user.id) or await context.guild.fetch_member(
|
||||
@@ -48,14 +50,18 @@ def nick_command():
|
||||
title="Nickname",
|
||||
description=f"**{member}'s** new nickname is **{nickname}**!",
|
||||
color=0x7289DA,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
).set_author(
|
||||
name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png"
|
||||
)
|
||||
await context.send(embed=embed)
|
||||
except:
|
||||
embed = discord.Embed(
|
||||
title="Missing Permissions!",
|
||||
description="An error occurred while trying to change the nickname of the user. Make sure my role is above the role of the user you want to change the nickname.",
|
||||
color=0xE02B2B,
|
||||
).set_author(name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png")
|
||||
).set_author(
|
||||
name="Moderation", icon_url="https://yes.nighty.works/raw/CPKHQd.png"
|
||||
)
|
||||
await context.send(embed=embed, ephemeral=True)
|
||||
|
||||
|
||||
return nick
|
||||
|
||||
Reference in New Issue
Block a user