Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

refactor💥: Improved ux for select menus #637

Merged
merged 3 commits into from
Sep 17, 2022
Merged

Conversation

LordOfPolls
Copy link
Member

What type of pull request is this?

  • Non-breaking code change
  • Breaking code change
  • Documentation change/addition
  • Tests change

Description

Updates Select Menu ux to be not shit.

Before

await channel.send(
        "Old SelectUX",
        components=Select(
            options=[
                SelectOption("test1", "test1"),
                SelectOption("test2", "test2"),
                SelectOption("test3", "test3"),
            ],
            placeholder="test",
        ),
    )

After

await channel.send(
        "New SelectMenu Menu UX test", components=SelectMenu(["test1", "test2", "test3"], placeholder="test")
    )

It is worth noting migration should be as simple as replacing Select with SelectMenu

Changes

  • Options can now be any reasonable type, be it SelectOption, dict, iterable, or str
  • Only options arg is positional, everything else is kwarg
  • Renamed Select -> SelectMenu to avoid conflicts with the event called Select

Checklist

  • I've formatted my code with Black
  • I've ensured my code works on Python 3.10.x
  • I've tested my code

LordOfPolls and others added 2 commits September 9, 2022 12:36
* feat 💥: delay non-raw listeners until client ready

* fix: dont delay error events
@LordOfPolls LordOfPolls added Improvement Something that is already implemented but can be done better New Feature::Library A new feature for the library labels Sep 9, 2022
Copy link
Member

@Kigstn Kigstn left a comment

Choose a reason for hiding this comment

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

The guides need to be updated too: Select -> SelectMenu

@LordOfPolls LordOfPolls merged commit c436659 into 2.x Sep 17, 2022
@LordOfPolls LordOfPolls deleted the improved_selectMenu_ux branch September 17, 2022 07:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Improvement Something that is already implemented but can be done better New Feature::Library A new feature for the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants