mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 23:04:43 +12:00
feat: add support for teams update (#9805)
* refactor(TeamMember): deprecate permissions property * feat: add support for team member roles * feat: add reference to external team member role enum * docs: suggested changes Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
parent
9dbc9542c4
commit
c66636da11
3 changed files with 17 additions and 0 deletions
|
@ -24,6 +24,7 @@ class TeamMember extends Base {
|
|||
/**
|
||||
* The permissions this Team Member has with regard to the team
|
||||
* @type {string[]}
|
||||
* @deprecated Use {@link TeamMember#role} instead.
|
||||
*/
|
||||
this.permissions = data.permissions;
|
||||
}
|
||||
|
@ -43,6 +44,14 @@ class TeamMember extends Base {
|
|||
*/
|
||||
this.user = this.client.users._add(data.user);
|
||||
}
|
||||
|
||||
if ('role' in data) {
|
||||
/**
|
||||
* The role of this Team Member
|
||||
* @type {TeamMemberRole}
|
||||
*/
|
||||
this.role = data.role;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -450,6 +450,11 @@
|
|||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/TeamMemberMembershipState}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external TeamMemberRole
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/TeamMemberRole}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @external TextInputStyle
|
||||
* @see {@link https://discord-api-types.dev/api/discord-api-types-v10/enum/TextInputStyle}
|
||||
|
|
3
packages/discord.js/typings/index.d.ts
vendored
3
packages/discord.js/typings/index.d.ts
vendored
|
@ -165,6 +165,7 @@ import {
|
|||
GuildOnboardingPromptType,
|
||||
AttachmentFlags,
|
||||
RoleFlags,
|
||||
TeamMemberRole,
|
||||
} from 'discord-api-types/v10';
|
||||
import { ChildProcess } from 'node:child_process';
|
||||
import { EventEmitter } from 'node:events';
|
||||
|
@ -2991,9 +2992,11 @@ export class TeamMember extends Base {
|
|||
private constructor(team: Team, data: RawTeamMemberData);
|
||||
public team: Team;
|
||||
public get id(): Snowflake;
|
||||
/** @deprecated Use {@link role} instead. */
|
||||
public permissions: string[];
|
||||
public membershipState: TeamMemberMembershipState;
|
||||
public user: User;
|
||||
public role: TeamMemberRole;
|
||||
|
||||
public toString(): UserMention;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue