discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.95k stars 1.26k forks source link

Guild#premium_role #1172

Closed Fyko closed 4 years ago

Fyko commented 4 years ago

I can't seem to find any documentation specifying which role, precisely, is the "Nitro Booster" role. The only property that makes the Boost role different from all others is that it's not Role#managed. And even then, after filtering by Role#managed it will return ALL API-created roles such as bot roles and the Twitch subscriber role.

night commented 4 years ago

What is the use case for knowing this role? Members have premium_since on them if they are boosting the server

Fyko commented 4 years ago

If you know the role you can easily change the name, position, color, etc. Without having the role ID included in the guild packet, we have to rely on filtering and using input (but can we rely on that?).

Edit: Can also be used for the sole purpose of displaying the role.

night commented 4 years ago

But why do you need to automatically change the name, position, color, etc? Could the server admin specify the role they want to update?

Fyko commented 4 years ago

Theoretically, yes. I personally don't have any use for it but in the DJS server we repeatedly get people asking how they can access the boost role ID.

Edit: See my edit above

kernel-dev commented 4 years ago

What's the current status on this feature? Is it being implemented anytime soon? I currently have a usage for the boost role in my economy plugin, but I do not have a 100% certainty that the retrieved role is the booster role.

Chew commented 4 years ago

Also, the Nitro Booster role IS marked as Managed in the API.

You can narrow it down by checking for roles that are managed, have more than 1 member, and if it does have 1 member, that member isn't a bot user. This doesn't work all that well on partnered YouTube or Twitch channels with their roles also being marked as managed, however you could check 2 current boosters (with the least amount of roles) for any managed roles in common.

It would be useful to have a thing for this, would save server strain 😉 , probably, idk

Fyko commented 4 years ago

Looks as if this has been implemented per https://github.com/discord/discord-api-docs/issues/1537#issuecomment-656308581.

// ... role instance
"tags": {
    "premium_subscriber": null
}