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:
bdistin
2019-06-25 13:31:48 -05:00
committed by SpaceEEC
parent 6100aceef2
commit a22aabf6a8
6 changed files with 223 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
const Snowflake = require('../util/Snowflake');
const { ClientApplicationAssetTypes, Endpoints } = require('../util/Constants');
const Base = require('./Base');
const Team = require('./Team');
const AssetTypes = Object.keys(ClientApplicationAssetTypes);
@@ -67,9 +68,9 @@ class ClientApplication extends Base {
/**
* The owner of this OAuth application
* @type {?User}
* @type {User|Team}
*/
this.owner = data.owner ? this.client.users.add(data.owner) : null;
this.owner = data.team ? new Team(this.client, data.team) : this.client.users.add(data.owner);
}
/**