# Discord Bot Dropdown Menu Issue
I'm working on a Discord bot and trying to create a dropdown menu. However, I'm running into an error when attempting to use the `Select` attribute. Here's the error message I'm getting:
discord.app_commands.errors.CommandInvokeError: Command ‘menu’ raised an exception: AttributeError: module ‘discord’ has no attribute ‘Select’
I've set up a command to display a menu, but it seems the `discord.Select` method isn't recognized. Here's a simplified version of what I'm trying to do:
```python
@bot.command()
async def show_menu(ctx):
menu = MyCustomSelect(
placeholder='Pick an option',
options=[
MyCustomOption(label='Choice A', value='a'),
MyCustomOption(label='Choice B', value='b'),
MyCustomOption(label='Choice C', value='c')
]
)
await ctx.send('Please select:', view=menu)
Any ideas on what might be causing this issue or how I can correctly implement a dropdown menu in my Discord bot?
yo, i had this same problem. try updating ur discord.py lib. in terminal, do ‘pip install -U discord.py’. if that doesn’t work, uninstall and reinstall it. then import like this:
The issue you’re facing is likely due to changes in the discord.py library structure. In recent versions, the Select component has been moved to the discord.ui module. To resolve this, ensure you’re using the latest discord.py version and import the necessary components correctly.
I’ve run into this exact issue before when working on my own Discord bot. The problem is likely that you’re using an older version of discord.py that doesn’t include the Select attribute.
To fix this, you’ll need to update your discord.py library to the latest version. You can do this by running:
pip install -U discord.py
If that doesn’t work, try uninstalling and reinstalling:
pip uninstall discord.py
pip install discord.py
After updating, you should be able to use discord.ui.Select instead of just discord.Select. Also, make sure you’re importing it correctly: