import discord
from discord.ext import commands
from discord.ext.commands import has_permissions
bot = commands.Bot(command_prefix='!')
@bot.command(pass_context = True)
@has_permissions(manage_roles=True, ban_members=True, kick_members=True)
async def kicktest(ctx, role: discord.Role):
for member in ctx.guild.members:
if role in member.roles:
await member.kick()
await ctx.send('чисто')
else:
print(role, member.roles)
await ctx.send('ошибка')
@bot.command(pass_context = True)
@has_permissions(manage_roles=True, ban_members=True, kick_members=True)
async def kicktest(ctx, role: discord.Role):
for member in ctx.guild.members:
if role in member.roles:
await member.kick()
await ctx.send('чисто')
else:
await ctx.send('ошибка')