sherpaBot/SherpaBot.py
async def ban(self, ctx, members: commands.Greedy[discord.Member],
                  delete_days: typing.Optional[int] = 0, *,
                  reason: str):
        """Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake"""
        if (ctx.channel.name == Constants.ADMIN_CHANNEL_NAME):  # to change to an id / channel not a name
            accept_decline = await ctx.send(
                "Do you really want to ban {}".format(" ".join([member.mention for member in members])))
            await accept_decline.add_reaction(Constants.CHECK)
            await accept_decline.add_reaction(Constants.CROSS)

            def check(reaction, user):
                return user == ctx.message.author and (str(reaction.emoji) == '✅' or str(reaction.emoji) == '❌')

            try:
                reaction, user = await self.bot.wait_for('reaction_add', timeout=60.0, check=check)
            except asyncio.TimeoutError:
                await accept_decline.delete()
                await ctx.send('Timed out')
            else:
                await accept_decline.delete()
                if reaction.emoji == Constants.CHECK:
                    for member in members:
                        await member.ban(delete_message_days=delete_days, reason=reason)
                    if delete_days is not None:
                        await ctx.send(
                            "Banned {} for {} days for {}".format(" ".join([member.mention for member in members]),
                                                                  delete_days, reason))
                    else:
                        await ctx.send(
                            "Banned {} forever, for {}".format(" ".join([member.mention for member in members]),
                                                               delete_days, reason))
                else:
                    await ctx.send("Bans canceled")
Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake
Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake
Mass bans members with an optional delete_days parameter send a message before banning people to be sure it ' s not a mistake
async def ban(self, ctx, members: commands.Greedy[discord.Member],
                  delete_days: typing.Optional[int] = 0, *,
                  reason: str):
        if (ctx.channel.name == Constants.ADMIN_CHANNEL_NAME):  
            accept_decline = await ctx.send(
                "Do you really want to ban {}".format(" ".join([member.mention for member in members])))
            await accept_decline.add_reaction(Constants.CHECK)
            await accept_decline.add_reaction(Constants.CROSS)
            def check(reaction, user):
                return user == ctx.message.author and (str(reaction.emoji) == '✅' or str(reaction.emoji) == '❌')
            try:
                reaction, user = await self.bot.wait_for('reaction_add', timeout=60.0, check=check)
            except asyncio.TimeoutError:
                await accept_decline.delete()
                await ctx.send('Timed out')
            else:
                await accept_decline.delete()
                if reaction.emoji == Constants.CHECK:
                    for member in members:
                        await member.ban(delete_message_days=delete_days, reason=reason)
                    if delete_days is not None:
                        await ctx.send(
                            "Banned {} for {} days for {}".format(" ".join([member.mention for member in members]),
                                                                  delete_days, reason))
                    else:
                        await ctx.send(
                            "Banned {} forever, for {}".format(" ".join([member.mention for member in members]),
                                                               delete_days, reason))
                else:
                    await ctx.send("Bans canceled")
async def ban ( self , ctx , members : commands . Greedy [ discord . Member ] , delete_days : typing . Optional [ int ] = 0 , * , reason : str ) : if ( ctx . channel . name == Constants . ADMIN_CHANNEL_NAME ) : accept_decline = await ctx . send ( "Do you really want to ban {}" . format ( " " . join ( [ member . mention for member in members ] ) ) ) await accept_decline . add_reaction ( Constants . CHECK ) await accept_decline . add_reaction ( Constants . CROSS ) def check ( reaction , user ) : return user == ctx . message . author and ( str ( reaction . emoji ) == '✅' o  s r(r e action.e m oji)  =  ' ') try : reaction , user = await self . bot . wait_for ( 'reaction_add' , timeout = 60.0 , check = check ) except asyncio . TimeoutError : await accept_decline . delete ( ) await ctx . send ( 'Timed out' ) else : await accept_decline . delete ( ) if reaction . emoji == Constants . CHECK : for member in members : await member . ban ( delete_message_days = delete_days , reason = reason ) if delete_days is not None : await ctx . send ( "Banned {} for {} days for {}" . format ( " " . join ( [ member . mention for member in members ] ) , delete_days , reason ) ) else : await ctx . send ( "Banned {} forever, for {}" . format ( " " . join ( [ member . mention for member in members ] ) , delete_days , reason ) ) else : await ctx . send ( "Bans canceled" )
Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake
Mass bans members with an optional delete_days parameter send a message before banning people to be sure it ' s not a mistake
"""Mass bans members with an optional delete_days parameter, send a message before banning people to be sure it's not a mistake""" # to change to an id / channel not a name
self
ctx
members
commands.Greedy[discord.Member]
delete_days
typing.Optional[int]
reason
str