Update role based on server tags updation #11408
Replies: 2 comments 3 replies
-
|
As of January 2026, this is unfortunately still not possible for real-time detection. While the Server Tag feature exists in the client, the Discord API currently does not send a Gateway Event when a user changes their Server Tag. This means that even though the data exists, Discord does not "notify" the bot when a change happens. Without this specific event trigger, discord.js (or any other library) cannot listen for the change to automatically add or remove roles in real-time. The only possible workaround right now is polling (fetching the member data repeatedly on a loop), but this is highly inefficient and not recommended as it will quickly hit API rate limits. |
Beta Was this translation helpful? Give feedback.
-
|
I have no idea where @HaskaZuki got that information from, but it's wrong and sounds like LLM garbage. To confirm this, i tested with the below code in discord.js version 14.25.1 and received the attached log. client.on(Events.UserUpdate, (pU, nU) => {
console.log({ pU: pU?.primaryGuild, nU: nU?.primaryGuild });
});Footnotes
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a usecase in which i would want to add or remove user's role if the server tag changes. On searching i found this discussion #10954 (comment) which mentions this:
Just wanted to know if this is available in discord.js now in Jan-2026 because the date on this is July-2025?
Beta Was this translation helpful? Give feedback.
All reactions