Client.on(guildMemberUpdate) - Check who added the role

Is there a way to check if a user or a bot added a role to a user? I want staff to be unable to self-assign certain roles, and only allow them to be assigned via the bot
2 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
nullopt
nulloptOP3y ago
DiscordClient.on("guildMemberUpdate", async (oldMember: GuildMember, newMember: GuildMember) => {
// check if the bot assigned the role
}
DiscordClient.on("guildMemberUpdate", async (oldMember: GuildMember, newMember: GuildMember) => {
// check if the bot assigned the role
}
Ah

Did you find this page helpful?