Im making a discord bot and a command im making is unbanall and im keep getting an error and now i debugged and got this i don't understand why it isnt working ive tried almost everything i feel like can someone help. THe code is @bot.command(name="unbanall")
async def unban_all_command(ctx):
try:
banned_users = await ctx.guild.bans()
banned_users_list = list(banned_users)
for ban_entry in banned_users_list:
user = ban_entry.user
await ctx.guild.unban(user, reason="Unban all")