mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
feature: teams support (#3350)
* basic teams support * export Team & TeamMember * use typedef * typings and some fixes * Update src/structures/TeamMember.js Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com> * fix Team#iconURL() * fix typings and a bug * fix states start at 1 * team icon hash can be null * fix owner typings
This commit is contained in:
33
typings/index.d.ts
vendored
33
typings/index.d.ts
vendored
@@ -255,7 +255,7 @@ declare module 'discord.js' {
|
||||
public icon: string;
|
||||
public id: Snowflake;
|
||||
public name: string;
|
||||
public owner: User | null;
|
||||
public owner: User | Team;
|
||||
public rpcOrigins: string[];
|
||||
public coverImage(options?: AvatarOptions): string;
|
||||
public fetchAssets(): Promise<ClientApplicationAsset>;
|
||||
@@ -264,6 +264,34 @@ declare module 'discord.js' {
|
||||
public toString(): string;
|
||||
}
|
||||
|
||||
export class Team extends Base {
|
||||
constructor(client: Client, data: object);
|
||||
public id: Snowflake;
|
||||
public name: string;
|
||||
public icon: string | null;
|
||||
public ownerID: Snowflake | null;
|
||||
public members: Collection<Snowflake, TeamMember>;
|
||||
|
||||
public readonly owner: TeamMember;
|
||||
public readonly createdAt: Date;
|
||||
public readonly createdTimestamp: number;
|
||||
|
||||
public iconURL(options?: AvatarOptions): string;
|
||||
public toJSON(): object;
|
||||
public toString(): string;
|
||||
}
|
||||
|
||||
export class TeamMember extends Base {
|
||||
constructor(client: Client, team: Team, data: object);
|
||||
public team: Team;
|
||||
public id: Snowflake;
|
||||
public permissions: string[];
|
||||
public membershipState: MembershipStates;
|
||||
public user: User;
|
||||
|
||||
public toString(): string;
|
||||
}
|
||||
|
||||
export interface ActivityOptions {
|
||||
name?: string;
|
||||
url?: string;
|
||||
@@ -1992,6 +2020,9 @@ declare module 'discord.js' {
|
||||
|
||||
type InviteResolvable = string;
|
||||
|
||||
type MembershipStates = 'INVITED'
|
||||
| 'ACCEPTED';
|
||||
|
||||
interface MessageCollectorOptions extends CollectorOptions {
|
||||
max?: number;
|
||||
maxProcessed?: number;
|
||||
|
||||
Reference in New Issue
Block a user