New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: teams support #3350
feature: teams support #3350
Conversation
@@ -67,9 +68,9 @@ class ClientApplication extends Base { | |||
|
|||
/** | |||
* The owner of this OAuth application | |||
* @type {?User} | |||
* @type {User|Team} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Owner and Team should be separated in my opinion. While the owner of an app that is in a team is fake, it's still an user. A warning should be added instead
Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com>
this.user = this.client.users.add(data.user); | ||
|
||
/** | ||
* The ID of the Team Member |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant it. This is redundant...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeamMembers are keyed by id in Team#members, the only id we have to relate to is the user id, which is no different than how GuildMembers' ids work.
I thought your original complaint is we weren't using the User instead of the raw user data, so that's why I made the change I did, which really doesn't matter which way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typings for ClientApplication#owner
need to reflect that the property can also be a Team.
any update on this? |
yes |
* feat(Teams): backport support for teams PR #3350 Commit: a22aabf * 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
* 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 reverts commit 20aa1a7.
Please describe the changes this PR makes and why it should be merged:
This adds support structures for Discord Teams. If you run Client#fetchApplication() you will now have a ClientApplication object that's owned by either a User or a Team along with all the other things the Teams data brings with it.
Note: TeamMember#permissions is likely to change in the future when proper permissions are implemented for them. I assume that property should become more like a BitField type object, but all of that data isn't available at this time as far as I am aware.
Status
Semantic versioning classification: