From 02c3f1e6859bda47118b2de75edd322e15a6df19 Mon Sep 17 00:00:00 2001 From: Agg <20499608+AggPro@users.noreply.github.com> Date: Wed, 20 Jun 2018 21:17:31 +0300 Subject: [PATCH] Added ban command And changed the response because if you were talking without commas you would need to breathe heavily and and and and *huff* --- src/cogs/moderation.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/cogs/moderation.py b/src/cogs/moderation.py index 8032a35..94c9e2d 100644 --- a/src/cogs/moderation.py +++ b/src/cogs/moderation.py @@ -32,7 +32,30 @@ class Moderation: await ctx.send(f'You kicked **`{member.name}`** from **`{ctx.guild.name}`**') except Exception as e: - await ctx.send('You may not use this command you do not have permission in server:\n\n**`{ctx.guild.name}`**' + await ctx.send('You may not use this command, as you do not have permission to do so:\n\n**`{ctx.guild.name}`**' + f'\n\n```py\n{e}\n```') + @commands.command() + async def ban(self, ctx, member: discord.Member = None): + """ + Ban a discord member from your server. + Only contributors can use this command. + + Usage: + - ban + + """ + await ctx.trigger_typing() + if ctx.author.id not in self.bot.ownerlist: + return await ctx.send('Only my contributors can use me like this :blush:', delete_after=10) + + if member is None: + await ctx.send('Are you sure you are capable of this command?') + try: + await member.ban() + await ctx.send(f'You kicked **`{member.name}`** from **`{ctx.guild.name}`**') + + except Exception as e: + await ctx.send('You may not use this command, as you do not have permission to do so:\n\n**`{ctx.guild.name}`**' f'\n\n```py\n{e}\n```') def setup(bot):