Skip to content
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

feat(Application): application flags #5147

Merged
merged 25 commits into from
Mar 31, 2021
Merged

feat(Application): application flags #5147

merged 25 commits into from
Mar 31, 2021

Conversation

vaporoxx
Copy link
Contributor

@vaporoxx vaporoxx commented Dec 23, 2020

Please describe the changes this PR makes and why it should be merged:

Adds support for the new application.flags property as of discord/discord-api-docs#2295. Since this is only sent with READY and not with Get Current Application, some parts of the lib needs a bit of restructuring:

  • New property client.applicationnull when instantiating, a partial application as soon as READY gets emitted
  • New property application.flags (obviously)
  • New property application.partial
  • client.fetchApplication() -> client.application.fetch()
  • client.generateInvite(): Promise<string> -> string (since id is sent with READY too)
  • Make now nullable properties actually nullable
  • A bit of refactoring

Status

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

Copy link
Contributor

@NotSugden NotSugden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should probably be info/warn tags on the description of Client#generateInvite() and the Client#application property saying they can only be used/present if the client is logged in

src/client/websocket/handlers/READY.js Outdated Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
@vaporoxx
Copy link
Contributor Author

there should probably be info/warn tags on the description of Client#generateInvite() and the Client#application property saying they can only be used/present if the client is logged in

I went with an error instead of adding it to the docs since that's what most methods do

src/structures/ClientApplication.js Outdated Show resolved Hide resolved
src/structures/ClientApplication.js Outdated Show resolved Hide resolved
src/structures/interfaces/Application.js Outdated Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
src/structures/ClientApplication.js Outdated Show resolved Hide resolved
@advaith1
Copy link
Contributor

advaith1 commented Feb 11, 2021

flags should be a BitField but unfortunately, the flags themselves haven't been documented yet and most of them aren't known (discord/discord-api-docs#2435)

@vladfrangu
Copy link
Member

flags should be a BitField but unfortunately, the flags themselves haven't been documented yet and most of them aren't known

Yeah, and I don't know if they should be documented - I'll ask later. But, flag wise, the main ones I know off are related to the intents switches

@advaith1 advaith1 mentioned this pull request Feb 13, 2021
5 tasks
@advaith1
Copy link
Contributor

bitfield flags:

MANAGED_EMOJI = 4,
GROUP_DM_CREATE = 16,
RPC_HAS_CONNECTED = 2048,
GATEWAY_PRESENCE = 4096,
GATEWAY_PRESENCE_LIMITED = 8192,
GATEWAY_GUILD_MEMBERS = 16384,
GATEWAY_GUILD_MEMBERS_LIMITED = 32768,
VERIFICATION_PENDING_GUILD_LIMIT = 65536,
EMBEDDED = 131072

@vaporoxx
Copy link
Contributor Author

where are those taken from? 👀

@advaith1
Copy link
Contributor

the client

src/structures/ClientApplication.js Outdated Show resolved Hide resolved
src/structures/ClientApplication.js Outdated Show resolved Hide resolved
src/structures/ClientApplication.js Show resolved Hide resolved
@vaporoxx vaporoxx mentioned this pull request Mar 30, 2021
@kyranet kyranet requested a review from vladfrangu March 31, 2021 08:32
src/structures/ClientApplication.js Outdated Show resolved Hide resolved
@iCrawl iCrawl merged commit 06e9d86 into discordjs:master Mar 31, 2021
@vaporoxx vaporoxx deleted the feat-application-flags branch March 31, 2021 21:22
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants