aboutsummaryrefslogtreecommitdiff
path: root/cogs
diff options
context:
space:
mode:
authorThomas Voss <57815710+Mango0x45@users.noreply.github.com>2020-07-11 23:00:26 +0000
committerGitHub <noreply@github.com>2020-07-11 23:00:26 +0000
commit0da672ab6b9a38029a2605b30cb65f400c5032e0 (patch)
tree366e2b4f3a3abd33c09010ca19b89a8b29e4b66a /cogs
parent47464b0619ee29eb9ec1a159e2d17334aaa4b144 (diff)
downloadsteve-bot-0da672ab6b9a38029a2605b30cb65f400c5032e0.tar
steve-bot-0da672ab6b9a38029a2605b30cb65f400c5032e0.tar.gz
steve-bot-0da672ab6b9a38029a2605b30cb65f400c5032e0.tar.bz2
steve-bot-0da672ab6b9a38029a2605b30cb65f400c5032e0.tar.lz
steve-bot-0da672ab6b9a38029a2605b30cb65f400c5032e0.tar.xz
steve-bot-0da672ab6b9a38029a2605b30cb65f400c5032e0.tar.zst
steve-bot-0da672ab6b9a38029a2605b30cb65f400c5032e0.zip
Update admin.py
Diffstat (limited to 'cogs')
-rwxr-xr-xcogs/admin.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/cogs/admin.py b/cogs/admin.py
index d2b3cab..f0ab204 100755
--- a/cogs/admin.py
+++ b/cogs/admin.py
@@ -157,6 +157,31 @@ class Admin(commands.Cog):
@commands.command()
@commands.check(is_botmaster)
+ async def ban(self, ctx, members: commands.Greedy[discord.Member]=False,
+ mute_minutes: int = 0,
+ *, reason: str = "absolutely no reason"):
+ """Mass mute members with an optional mute_minutes parameter to time it"""
+
+ if not members:
+ await ctx.send("You need to name someone to ban")
+ return
+ elif type(members)==str:
+ members = [self.bot.get_user(int(members))]
+ for member in members:
+ if self.bot.user == member: # what good is a muted bot?
+ embed = discord.Embed(title = "You can't ban me, I'm an almighty bot")
+ await ctx.send(embed = embed)
+ continue
+ await guild.ban(member, reason="A reason idk")
+ await ctx.send("{0.mention} has been banned by {1.mention} for *{2}*".format(member, ctx.author, reason))
+
+ if mute_minutes > 0:
+ await asyncio.sleep(mute_minutes * 60)
+ for member in members:
+ await guild.unban(member, reason="Time is up")
+
+ @commands.command()
+ @commands.check(is_botmaster)
async def logs(self, ctx):
"""Send the discord.log file"""
await ctx.message.delete()