From 9a737d5d74eb171f10e2288572eafe1eacd9a105 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh <102361830+SeaswimmerTheFsh@users.noreply.github.com> Date: Wed, 21 Jun 2023 13:33:45 -0400 Subject: [PATCH] added a kick command --- cogs/moderation.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cogs/moderation.py b/cogs/moderation.py index 6ca29f3..fa64460 100644 --- a/cogs/moderation.py +++ b/cogs/moderation.py @@ -65,6 +65,19 @@ class Moderation(commands.Cog): await response.edit(content=f"{response.content}\n*Failed to send DM, user likely has the bot blocked.*") Moderation.mysql_log(self, ctx, moderation_type='Warning', target_id=target.id, duration='NULL', reason=reason) + @commands.command() + async def kick(self, ctx: commands.Context, target: commands.MemberConverter, *, reason: str): + if not reason: + await ctx.message.reply("Please include a reason!") + return + response = await ctx.message.reply(f"{target.mention} has been kicked!\n**Reason** - `{reason}`") + try: + embeds = [revolt.SendableEmbed(title="Warned", description=f"You have been kicked from {ctx.server.name}!\n### Reason\n`{reason}`", colour="#5d82d1")] + await target.send(embeds=embeds) + except revolt.errors.HTTPError: + await response.edit(content=f"{response.content}\n*Failed to send DM, user likely has the bot blocked.*") + Moderation.mysql_log(self, ctx, moderation_type='Kick', target_id=target.id, duration='NULL', reason=reason) + @commands.command() async def ban(self, ctx: commands.Context, target: commands.MemberConverter, *, reason: str): if not reason: