Vinium
Vinium

Reputation: 21

discord.py on_member_ban with no perms

Is it possible to know whenever a member gets banned using on_member_ban (or any other possible method) in a server without having any ban/admin permissions?

Upvotes: 0

Views: 203

Answers (1)

Eric Jin
Eric Jin

Reputation: 3924

Yes, you don't need ban permissions to view them.

However, you do need to enable ban intents, but that is enabled by default so in most cases you don't need to worry about it.

A simple event like this executes even when the bot does not have permission:

@client.event
async def on_member_ban(guild, member):
    print(f'Member was banned in {guild.name}: {member.id} ({member})')

Upvotes: 2

Related Questions