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*
This commit is contained in:
Agg 2018-06-20 21:17:31 +03:00 committed by GitHub
parent 7321413c90
commit 02c3f1e685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,30 @@ class Moderation:
await ctx.send(f'You kicked **`{member.name}`** from **`{ctx.guild.name}`**') await ctx.send(f'You kicked **`{member.name}`** from **`{ctx.guild.name}`**')
except Exception as e: 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 <discord.member>
"""
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```') f'\n\n```py\n{e}\n```')
def setup(bot): def setup(bot):