-
-
Notifications
You must be signed in to change notification settings - Fork 127
feat: Support select in modals #1321
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dc2f2ee
to
42bfca7
Compare
payloads/v10/channel.ts
Outdated
export type APIStringSelectComponent = APIStringSelectComponentInActionRow | APIStringSelectComponentInModal; | ||
|
||
export interface APIStringSelectComponentInActionRow extends APIBaseSelectMenuComponent<ComponentType.StringSelect> { | ||
/** | ||
* Specified choices in a select menu; max 25 | ||
*/ | ||
options: APISelectMenuOption[]; | ||
} | ||
|
||
export interface APIStringSelectComponentInModal extends APIBaseSelectMenuComponent<ComponentType.StringSelect> { | ||
/** | ||
* Specified choices in a select menu; max 25 | ||
*/ | ||
options: APISelectMenuOption[]; | ||
/** | ||
* Whether this component is required | ||
*/ | ||
required?: boolean; | ||
} | ||
|
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.
Like I said in https://canary.discord.com/channels/222078108977594368/999796393810067607/1402933854477619290, unify in one interface please
export interface APILabelComponent extends APIBaseComponent<ComponentType.Label> { | ||
label: string; | ||
description?: string; | ||
component: APIComponentInModalLabel; |
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'd probably do APIComponentInLabel, not InModalLabel, should discord ever make this component work outside modals too
369800e
to
277fe68
Compare
/** | ||
* Labels for use in modals. | ||
*/ |
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 would not document this like this. You shouldn't make assumptions about where components will be allowed in the future.
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 use discord doc strings unless we don't have them, sooo... what shall it be? :D
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.
for cv2 I just didn't write doc strings until the discord docs were out lol
https://discord.com/channels/222078108977594368/1402934237358985246