diff options
author | ziro <palembani@gmail.com> | 2020-08-05 10:03:34 +0000 |
---|---|---|
committer | ziro <palembani@gmail.com> | 2020-08-05 10:03:34 +0000 |
commit | 10fb0565b5c9af7b1b1688e5629f1becf8156bee (patch) | |
tree | 597819e3900a109a517791e9f8c7bfe4b8743b89 /cogs | |
parent | e4e5c35234ded29b23f8b07861feb536a9cca4f5 (diff) | |
download | steve-bot-10fb0565b5c9af7b1b1688e5629f1becf8156bee.tar steve-bot-10fb0565b5c9af7b1b1688e5629f1becf8156bee.tar.gz steve-bot-10fb0565b5c9af7b1b1688e5629f1becf8156bee.tar.bz2 steve-bot-10fb0565b5c9af7b1b1688e5629f1becf8156bee.tar.lz steve-bot-10fb0565b5c9af7b1b1688e5629f1becf8156bee.tar.xz steve-bot-10fb0565b5c9af7b1b1688e5629f1becf8156bee.tar.zst steve-bot-10fb0565b5c9af7b1b1688e5629f1becf8156bee.zip |
+ Added kick and ban command
Diffstat (limited to 'cogs')
-rw-r--r-- | cogs/moderator.py | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/cogs/moderator.py b/cogs/moderator.py index 7d78741..0506c6b 100644 --- a/cogs/moderator.py +++ b/cogs/moderator.py @@ -92,7 +92,7 @@ class Admin(commands.Cog): @commands.command(hidden=True) @commands.has_any_role("Server Moderator","Zi") - async def unmute(self, ctx, member: discord.Member=None, reason: str="No Reason"): + async def unmute(self, ctx, member: discord.Member=None): if member is None: await ctx.send("Please specify the member you want to unmute.") return @@ -103,5 +103,36 @@ class Admin(commands.Cog): else: await ctx.send(f'{member.mention} is not muted.') + @commands.command(hidden=True) + @commands.has_any_role("Server Moderator","Zi") + async def kick(self, ctx, member: discord.Member=None, reason: str="No Reason"): + if member is None: + await ctx.send("Please specify the member you want to kick.") + return + if self.bot.user == member: # Just why would you want to mute him? + await ctx.send(f'You\'re not allowed to kick ziBot!') + else: + await member.send(f'You have been kicked from {ctx.guild.name} for {reason}!') + await ctx.guild.kick(member, reason=reason) + await ctx.send(f'{member.mention} has been kicked by {ctx.author.mention} for {reason}!') + + @commands.command(hidden=True) + @commands.has_any_role("Server Moderator","Zi") + async def ban(self, ctx, member: discord.Member=None, reason: str="No Reason", min_ban: int=0): + if member is None: + await ctx.send("Please specify the member you want to ban.") + return + if self.bot.user == member: # Just why would you want to mute him? + await ctx.send(f'You\'re not allowed to ban ziBot!') + else: + await member.send(f'You have been banned from {ctx.guild.name} for {reason}!') + await ctx.guild.ban(member, reason=reason) + await ctx.send(f'{member.mention} has been banned by {ctx.author.mention} for {reason}!') + + if min_ban > 0: + await asyncio.sleep(min_ban * 60) + await ctx.guild.unban(member, reason="timed out") + # TODO: Make unban command? + def setup(bot): bot.add_cog(Admin(bot)) |