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

Update Application #1207

Merged
merged 3 commits into from
Mar 30, 2024
Merged

Update Application #1207

merged 3 commits into from
Mar 30, 2024

Conversation

key2peace
Copy link
Collaborator

Added missing attributes and placed them in the order of api docs

Added missing attributes and placed them in the order of api docs
@SQKo
Copy link
Member

SQKo commented Mar 17, 2024

By the way to be noted for other part class, do not sort fillable by Discord API docs but:

  1. IDs / repository keys go first
  2. Repositories Go Last
  3. Equals/close to 1:1 to the actual payload

The first and second was important in Channel and Guild, e.g. permission, it was bugged once since the channel/guild id is sorted after repository object and the permission was stored for null channel/guild id. It really that matters. 50636be
For 3rd, it is for parsing json speed. Try var_dump the raw payload first (the stdClass, not from Event:: which is already created as Part), for REST calls just refer to the discord-api-specs

For example Get My Application in discord-api-specs postman:

{
	"id": "<string>",
	"name": "<string>",
	"description": "<string>",
	"verify_key": "<string>",
	"flags": "<integer>",
	"redirect_uris": [
		"<string,null-uri>",
		"<string,null-uri>"
	],
	"owner": {
		"id": "<string>",
		"username": "<string>",
		"discriminator": "<string>",
		"public_flags": "<integer>",
		"flags": "<integer>",
		"avatar": "<string,null>",
		"bot": "<boolean,null>",
		"system": "<boolean,null>",
		"banner": "<string,null>",
		"accent_color": "<integer,null>"
	},
	"icon": "<string,null>",
	"type": "<null>",
	"cover_image": "<string,null>",
	"primary_sku_id": "<string,null>",
	"bot": "<null>",
	"slug": "<string,null>",
	"guild_id": "<string,null>",
	"rpc_origins": null,
	"bot_public": "<boolean,null>",
	"bot_require_code_grant": "<boolean,null>",
	"terms_of_service_url": "<string,null-uri>",
	"privacy_policy_url": "<string,null-uri>",
	"custom_install_url": "<string,null-uri>",
	"install_params": "<null>",
	"max_participants": "<integer,null>",
	"tags": [
		"<string>",
		"<string>"
	],
	"interactions_endpoint_url": "<string,null-uri>",
	"role_connections_verification_url": "<string,null-uri>",
	"approximate_guild_count": "<integer,null>"
}

The orders in docs are usually inserted randomly by whoever made PR in the docs api, thus cannot be used as as fillable order. PHPdocs attributes are fine to follow though

@SQKo SQKo merged commit 5695062 into master Mar 30, 2024
2 checks passed
@SQKo SQKo deleted the key2peace-patch-2 branch March 30, 2024 08:44
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.

2 participants