Fix kick command
This commit is contained in:
parent
328dd2a1bc
commit
a1a9543237
1 changed files with 68 additions and 67 deletions
|
@ -13,8 +13,7 @@ class KickCog(CacheCog):
|
|||
def __init__(self, bot):
|
||||
super().__init__(bot)
|
||||
|
||||
|
||||
@cog_ext.cog_slash(
|
||||
@cog_ext.cog_slash(
|
||||
name="kick",
|
||||
description="Kick a user",
|
||||
options=[
|
||||
|
@ -31,9 +30,9 @@ class KickCog(CacheCog):
|
|||
option_type=3,
|
||||
),
|
||||
],
|
||||
)
|
||||
@admin_or_permissions(kick_members=True)
|
||||
async def _kick(self, ctx: SlashContext, user: User, reason=None):
|
||||
)
|
||||
@admin_or_permissions(kick_members=True)
|
||||
async def _kick(self, ctx: SlashContext, user: User, reason=None):
|
||||
if not user or user == ctx.author:
|
||||
await ctx.send("You cannot kick yourself.", hidden=True)
|
||||
return
|
||||
|
@ -44,7 +43,9 @@ async def _kick(self, ctx: SlashContext, user: User, reason=None):
|
|||
await ctx.send("Reason must be < 100 characters", hidden=True)
|
||||
return
|
||||
if not reason:
|
||||
reason = "Mr. Stark is displeased with your presence. Please leave."
|
||||
reason = (
|
||||
"Mr. Stark is displeased with your presence. Please leave."
|
||||
)
|
||||
guild_name = ctx.guild.name
|
||||
embed = build_embed(
|
||||
title=f"You have been kicked from {guild_name}",
|
||||
|
|
Loading…
Add table
Reference in a new issue