Skip to content

Commit

Permalink
Revert "feature: teams support (discordjs#3350)"
Browse files Browse the repository at this point in the history
This reverts commit 20aa1a7.
  • Loading branch information
samsamson33 committed Feb 27, 2020
1 parent fb46e2f commit d023231
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 223 deletions.
2 changes: 0 additions & 2 deletions src/index.js
Expand Up @@ -85,8 +85,6 @@ module.exports = {
ReactionEmoji: require('./structures/ReactionEmoji'),
RichPresenceAssets: require('./structures/Presence').RichPresenceAssets,
Role: require('./structures/Role'),
Team: require('./structures/Team'),
TeamMember: require('./structures/TeamMember'),
TextChannel: require('./structures/TextChannel'),
User: require('./structures/User'),
VoiceChannel: require('./structures/VoiceChannel'),
Expand Down
5 changes: 2 additions & 3 deletions src/structures/ClientApplication.js
Expand Up @@ -3,7 +3,6 @@
const Snowflake = require('../util/Snowflake');
const { ClientApplicationAssetTypes, Endpoints } = require('../util/Constants');
const Base = require('./Base');
const Team = require('./Team');

const AssetTypes = Object.keys(ClientApplicationAssetTypes);

Expand Down Expand Up @@ -68,9 +67,9 @@ class ClientApplication extends Base {

/**
* The owner of this OAuth application
* @type {User|Team}
* @type {?User}
*/
this.owner = data.team ? new Team(this.client, data.team) : this.client.users.add(data.owner);
this.owner = data.owner ? this.client.users.add(data.owner) : null;
}

/**
Expand Down
109 changes: 0 additions & 109 deletions src/structures/Team.js

This file was deleted.

62 changes: 0 additions & 62 deletions src/structures/TeamMember.js

This file was deleted.

15 changes: 0 additions & 15 deletions src/util/Constants.js
Expand Up @@ -145,8 +145,6 @@ exports.Endpoints = {
makeImageUrl(`${root}/channel-icons/${channelID}/${hash}`, { size, format }),
Splash: (guildID, hash, format = 'webp', size) =>
makeImageUrl(`${root}/splashes/${guildID}/${hash}`, { size, format }),
TeamIcon: (teamID, hash, { format = 'webp', size } = {}) =>
makeImageUrl(`${root}/team-icons/${teamID}/${hash}`, { size, format }),
};
},
invite: (root, code) => `${root}/${code}`,
Expand Down Expand Up @@ -571,19 +569,6 @@ exports.DefaultMessageNotifications = [
'MENTIONS',
];

/**
* The value set for a team members's membership state:
* * INVITED
* * ACCEPTED
* @typedef {string} MembershipStates
*/
exports.MembershipStates = [
// They start at 1
null,
'INVITED',
'ACCEPTED',
];

function keyMirror(arr) {
let tmp = Object.create(null);
for (const value of arr) tmp[value] = value;
Expand Down
33 changes: 1 addition & 32 deletions typings/index.d.ts
Expand Up @@ -255,7 +255,7 @@ declare module 'discord.js' {
public icon: string;
public id: Snowflake;
public name: string;
public owner: User | Team;
public owner: User | null;
public rpcOrigins: string[];
public coverImage(options?: AvatarOptions): string;
public fetchAssets(): Promise<ClientApplicationAsset>;
Expand All @@ -264,34 +264,6 @@ 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;
Expand Down Expand Up @@ -2020,9 +1992,6 @@ declare module 'discord.js' {

type InviteResolvable = string;

type MembershipStates = 'INVITED'
| 'ACCEPTED';

interface MessageCollectorOptions extends CollectorOptions {
max?: number;
maxProcessed?: number;
Expand Down

0 comments on commit d023231

Please sign in to comment.