mirror of
https://github.com/wlinator/luminara.git
synced 2024-10-02 18:03:12 +00:00
refactor: Update warn command
This commit is contained in:
parent
244d23e8d9
commit
d100cd792c
1 changed files with 18 additions and 2 deletions
|
@ -15,10 +15,26 @@ class Warn(commands.Cog):
|
|||
def __init__(self, bot: commands.Bot):
|
||||
self.bot = bot
|
||||
|
||||
@commands.hybrid_command(name="warn", description="Warn a user")
|
||||
@commands.hybrid_command(name="warn", aliases=["w"])
|
||||
@commands.has_permissions(manage_messages=True)
|
||||
@commands.guild_only()
|
||||
async def warn(self, ctx: commands.Context[commands.Bot], target: discord.Member, *, reason: str | None = None):
|
||||
async def warn(
|
||||
self,
|
||||
ctx: commands.Context[commands.Bot],
|
||||
target: discord.Member,
|
||||
*,
|
||||
reason: str | None = None,
|
||||
) -> None:
|
||||
"""
|
||||
Warn a user.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
target: discord.Member
|
||||
The user to warn.
|
||||
reason: str | None
|
||||
The reason for the warn. Defaults to None.
|
||||
"""
|
||||
if not ctx.guild or not ctx.author or not ctx.bot.user:
|
||||
raise LumiException
|
||||
|
||||
|
|
Loading…
Reference in a new issue