feat: new select menus (#8793)

* feat(builders): new select menus

* chore: better re-exporting of deprecated classes

* feat: new select menus

* chore: typings

* chore: add missing todo comment

* chore: finish updating tests

* chore: add runtime deprecation warnings

* chore: format deprecation warning

* feat(BaseInteraction): isAnySelectMenu

* chore: requested changes

* fix: deprecation comments

* chore: update @deprecated comments in typings

* chore: add tests for select menu type narrowing

* fix: bad auto imports

Co-authored-by: Julian Vennen <julian@aternos.org>

* fix: properly handle resolved members

* fix: collectors

* chore: suggested changes

Co-authored-by: Almeida <almeidx@pm.me>

* fix(typings): bad class extends

* feat(ChannelSelectMenuBuilder): validation

* chore: update todo comment

* refactor(ChannelSelectMenu): better handling of channel_types state

* chore: style nit

* chore: suggested nits

Co-authored-by: Aura Román <kyradiscord@gmail.com>

Co-authored-by: Julian Vennen <julian@aternos.org>
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Aura Román <kyradiscord@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
DD
2022-11-01 19:36:05 +02:00
committed by GitHub
parent 8b400ca975
commit 5152abf728
50 changed files with 1528 additions and 469 deletions

View File

@@ -0,0 +1,31 @@
import type { APIMentionableSelectComponent } from 'discord-api-types/v10';
import { ComponentType } from 'discord-api-types/v10';
import { BaseSelectMenuBuilder } from './BaseSelectMenu.js';
export class MentionableSelectMenuBuilder extends BaseSelectMenuBuilder<APIMentionableSelectComponent> {
/**
* Creates a new select menu from API data
*
* @param data - The API data to create this select menu with
* @example
* Creating a select menu from an API data object
* ```ts
* const selectMenu = new MentionableSelectMenuBuilder({
* custom_id: 'a cool select menu',
* placeholder: 'select an option',
* max_values: 2,
* });
* ```
* @example
* Creating a select menu using setters and API data
* ```ts
* const selectMenu = new MentionableSelectMenuBuilder({
* custom_id: 'a cool select menu',
* })
* .setMinValues(1)
* ```
*/
public constructor(data?: Partial<APIMentionableSelectComponent>) {
super({ ...data, type: ComponentType.MentionableSelect });
}
}