aboutsummaryrefslogtreecommitdiff
path: root/cogs/moderator.py
diff options
context:
space:
mode:
Diffstat (limited to 'cogs/moderator.py')
-rw-r--r--cogs/moderator.py33
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))