feat(Teams): backport support for teams (#3357)

* feat(Teams): backport support for teams

PR #3350
Commit: a22aabf6a8

* fix(TeamMember): fix name of client property

* refactor(OAuth2Application): make team nullable instead of optional

* typings(OAuth2Application): make team nullable instable of optional

* docs(OAuth2Application): deprecate and add an info to team property
This commit is contained in:
SpaceEEC
2019-07-11 13:10:54 +02:00
committed by GitHub
parent c355236f7f
commit 0cd7556934
5 changed files with 231 additions and 0 deletions

32
typings/index.d.ts vendored
View File

@@ -935,6 +935,7 @@ declare module 'discord.js' {
public rpcApplicationState: boolean;
public rpcOrigins: string[];
public secret: string;
public team: Team | null;
public reset(): OAuth2Application;
public toString(): string;
}
@@ -1232,6 +1233,34 @@ declare module 'discord.js' {
public setBitrate(bitrate: number | 'auto'): void;
}
export class Team {
constructor(client: Client, data: object);
public readonly client: Client;
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public icon: string | null;
public readonly iconURL: string;
public id: Snowflake;
public members: Collection<Snowflake, TeamMember>;
public name: string;
public readonly owner: TeamMember;
public ownerID: Snowflake | null;
public toString(): string;
}
export class TeamMember {
constructor(client: Client, team: Team, data: object);
public readonly client: Client;
public id: Snowflake;
public membershipState: MembershipStates;
public permissions: string[];
public team: Team;
public user: User;
public toString(): string;
}
export class TextChannel extends TextBasedChannel(GuildChannel) {
constructor(guild: Guild, data: object);
public lastMessageID: string;
@@ -1873,6 +1902,9 @@ declare module 'discord.js' {
type InviteResolvable = string;
type MembershipStates = 'INVITED'
| 'ACCEPTED';
type MessageCollectorOptions = CollectorOptions & {
max?: number;
maxMatches?: number;