How can I know if a member manages another member?

No idea how to do this one
7 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
duck
duck2y ago
this is a really vague question, and I'm not sure why this is in #djs-voice but likely you'd want to wait for the new GUILD_AUDIT_LOG_ENTRY_CREATE event to be implemented in the next release
Isra
IsraOP2y ago
Oh I meant if a members top role is higher or whatever discord uses to decide who can ban who
d.js docs
d.js docs2y ago
property GuildMember#manageable Whether the client user is above this user in the hierarchy, according to role position and guild ownership. This is a prerequisite for many moderative actions.
Isra
IsraOP2y ago
@ducktrshessami Sorry for pinging you again but I was looking for a function that checks if member A can ban/kick/mute member B
duck
duck2y ago
ah sorry there isn't a function like that, but if you check out the source for <GuildMember>.bannable, <GuildMember>.kickable, <GuildMember>.moderatable, and <GuildMember>.mangeable you could write something similar to check for other members than the client user https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/structures/GuildMember.js#L247
Isra
IsraOP2y ago
Thanks!
Want results from more Discord servers?
Add your server