-
-
Notifications
You must be signed in to change notification settings - Fork 121
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!: components v2 #1190
base: main
Are you sure you want to change the base?
feat!: components v2 #1190
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
also collapse deno diffs in gh
I've published Publish command for future use
|
payloads/v10/channel.ts
Outdated
export type APIMessageComponent = | ||
| APIMessageActionRowComponent | ||
| APIMessageTopLevelComponent | ||
| APISectionAccessoryComponent; |
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.
Really? Buttons work too?
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.
well buttons are already in APIMessageActionRowComponent - I think this type is just any component that can be anywhere inside a message
@@ -914,6 +914,10 @@ export enum MessageFlags { | |||
* This message has a snapshot (via Message Forwarding) | |||
*/ | |||
HasSnapshot = 1 << 14, | |||
/** | |||
* This flag is required to use new components |
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.
You may want to consider adding documentation around what this flag actually does (additional components, restrictions on other fields, etc). Additionally, these components wont be "new" forever, so improved documentation may be in order
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.
Currently descriptions are temporarily copied from the alpha readme - once the docs pr is out with proper descriptions we'll use those
/** | ||
* int32, auto generated via increment if not provided | ||
*/ | ||
id?: number; |
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.
Not sure how discord-api-types would want to model it, but id
is optional on request, but will always be provided as part of the response.
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.
We have other places where that's an issue, usually we either create rest-specific types from the api ones or document it as always present when received
proxy_url?: string; | ||
width?: number | null; | ||
height?: number | null; | ||
placeholder?: string | null; | ||
placeholder_version?: number | null; | ||
content_type?: string | null; | ||
loading_state?: UnfurledMediaItemLoadingState; | ||
flags?: number; |
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.
Unclear if discord-api-types has a separation between request and response models, but url
is the only dev-settable field. All others are provided by discord.
Please describe the changes this PR makes and why it should be merged:
uikit/components v2 :)
If applicable, please reference Discord API Docs PRs or commits that influenced this PR:
soon tm