mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
feat(Role): role tags (#4628)
* feat(Role): role tags * fix(RoleManager): fix js docs and mark nullable * fix(Role): typings tags are be null, not undefined * fix(Role): getters should actually return a bool * fix(RoleManager): typo * fix(Role): should always return a boolean * fix(Gmrm): getter should return null * fix(RoleManager): getters should return null * fix: typing getters should return null * fix(Role): docs grammar and consistency * chore: prefer in operator over Reflect#has * feat(GmRm): botRole getter * fix(GmRm): use the actual properties * feat(RoleManager): rem myRole in pref o botRoleFor * fix(Role): remove obsolete is- getters * fix: checking tags after getter removal * chore: identifier naming consistency * chore: prefer explicit true type over boolean * fix: typo * feat(Integration): Add Integration#roles getter (#1) * fix(RoleManager): remove bot check r:partials * feat(RoleManager): robustness against uncached u * docs: possibly undefined Co-authored-by: Jan <66554238+Vaporox@users.noreply.github.com>
This commit is contained in:
@@ -83,6 +83,16 @@ class Integration extends Base {
|
||||
this._patch(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* All roles that are managed by this integration
|
||||
* @type {Collection<Snowflake, Role>}
|
||||
* @readonly
|
||||
*/
|
||||
get roles() {
|
||||
const roles = this.guild.roles.cache;
|
||||
return roles.filter(role => role.tags && role.tags.integrationID === this.id);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
/**
|
||||
* The behavior of expiring subscribers
|
||||
|
||||
Reference in New Issue
Block a user