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

Adding a default parameter in select view causes issues #55

Closed
ArexiumLimited opened this issue Apr 17, 2024 · 1 comment
Closed

Adding a default parameter in select view causes issues #55

ArexiumLimited opened this issue Apr 17, 2024 · 1 comment

Comments

@ArexiumLimited
Copy link

ArexiumLimited commented Apr 17, 2024

Describe the bug

I'm trying to make a select a default. It does kinda work. And it does say that is the default select but if I click some other select aka Xbox it goes to that embed but the select is stuck at the default select aka playstation. I really want default selects so I hope someone fixes this issue.

Minimal Reproducible Code

@bot.hybrid_command(name="help", description="Get information about commands")
async def help(ctx):
    menu = ViewMenu(ctx, menu_type=ViewMenu.TypeEmbed)
    menu.add_page(discord.Embed(title="「 🎉 」Fun ", description="anything", color=discord.Color.blurple()))
    menu.add_page(discord.Embed(title="「 🔨 」Moderation ", description="add info2 stuff here", color=discord.Color.blurple()))
    menu.add_page(discord.Embed(title="A showcase of console video games", color=discord.Color.blurple()))
    menu.add_select(ViewSelect(title="Commands", options={
        discord.SelectOption(label="Playstation", emoji="<:PlayStation:549638412538478602>", default=True) : [
            Page(embed=discord.Embed(title="Ratchet & Clank", description=..., color=discord.Color.yellow()).set_image(url="https://picsum.photos/200")),
            Page(embed=discord.Embed(title="God of War", description=..., color=discord.Color.blue()).set_image(url="https://picsum.photos/200"))
        ],
        discord.SelectOption(label="Xbox", emoji="<:Xbox:501880493285834752>") : [
            Page(embed=discord.Embed(title="Halo Infinite", description=..., color=discord.Color.green()).set_image(url="https://picsum.photos/200")),
            Page(embed=discord.Embed(title="Gears of War 4", description=..., color=discord.Color.red()).set_image(url="https://picsum.photos/200"))
        ]
    }))

    back_button = ViewButton(style=discord.ButtonStyle.primary, label='', emoji='<:left:1227864319790809168>' ,custom_id=ViewButton.ID_PREVIOUS_PAGE)
    menu.add_button(back_button)
    next_button = ViewButton(style=discord.ButtonStyle.success, label='', emoji='<:right:1227818792311066685>',custom_id=ViewButton.ID_NEXT_PAGE)
    menu.add_button(next_button)
    link_button = ViewButton(style=discord.ButtonStyle.link, emoji='🌍', label='Link to Google', url='https://google.com')
    menu.add_button(link_button)
    await menu.start()

Traceback

None

Library Version

- Python v3.11.4-final
- discord.py v2.3.2-final
- aiohttp v3.8.6
- system info: Linux 4.19.191+ #1 SMP PREEMPT Tue Aug 8 18:51:39 CST 2023```

### Required Checklist

- [X] I am using discord.py 2.0 or higher
- [X] I am using reactionmenu 3.1.0 or higher
- [X] I have the required [intents](https://github.com/Defxult/reactionmenu#intents) enabled

### Additional Comments

_No response_
@ArexiumLimited ArexiumLimited added the unconfirmed bug The bug cannot be replicated when the minimal code provided was tested label Apr 17, 2024
@Defxult Defxult removed the unconfirmed bug The bug cannot be replicated when the minimal code provided was tested label Apr 20, 2024
@Defxult
Copy link
Owner

Defxult commented Apr 20, 2024

Hey! The selects were never designed to have default selects like in your example. It's designed so the user would have to select an option each time and upon selection would navigate to its associated pages. That's why it gets "stuck" when the new embeds are displayed (you can't select something that's already selected).

In addition without going too deep into an explanation, allowing this capability isn't worth it when it comes to performance.

What I'll end up doing is documenting that this isn't possible to prevent the opening of issues relating to this topic. Thanks for opening the issue!

@Defxult Defxult closed this as not planned Won't fix, can't repro, duplicate, stale Apr 20, 2024
Defxult added a commit that referenced this issue Apr 20, 2024
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

No branches or pull requests

2 participants