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):
|
def __init__(self, bot):
|
||||||
super().__init__(bot)
|
super().__init__(bot)
|
||||||
|
|
||||||
|
@cog_ext.cog_slash(
|
||||||
@cog_ext.cog_slash(
|
|
||||||
name="kick",
|
name="kick",
|
||||||
description="Kick a user",
|
description="Kick a user",
|
||||||
options=[
|
options=[
|
||||||
|
@ -31,9 +30,9 @@ class KickCog(CacheCog):
|
||||||
option_type=3,
|
option_type=3,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@admin_or_permissions(kick_members=True)
|
@admin_or_permissions(kick_members=True)
|
||||||
async def _kick(self, ctx: SlashContext, user: User, reason=None):
|
async def _kick(self, ctx: SlashContext, user: User, reason=None):
|
||||||
if not user or user == ctx.author:
|
if not user or user == ctx.author:
|
||||||
await ctx.send("You cannot kick yourself.", hidden=True)
|
await ctx.send("You cannot kick yourself.", hidden=True)
|
||||||
return
|
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)
|
await ctx.send("Reason must be < 100 characters", hidden=True)
|
||||||
return
|
return
|
||||||
if not reason:
|
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
|
guild_name = ctx.guild.name
|
||||||
embed = build_embed(
|
embed = build_embed(
|
||||||
title=f"You have been kicked from {guild_name}",
|
title=f"You have been kicked from {guild_name}",
|
||||||
|
|
Loading…
Add table
Reference in a new issue