#๐Ÿ”’ how can i put all of the text channels inside of select drop down menu

14 messages ยท Page 1 of 1 (latest)

tardy pelican
#

okay can anyone help me why this isnt working

class SelectMenu(discord.ui.ChannelSelect):
    def __init__(self):
        discord.ui.ChannelSelect(placeholder="Select an option", max_values=1, min_values=1, channel_types=[discord.ChannelType.text])
        super().__init__()


class Select(discord.ui.View):
    def __init__(self):
        super().__init__()
        self.add_item(SelectMenu())
rich umbraBOT
#

@tardy pelican

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

tardy pelican
#
    @app_commands.default_permissions(administrator=True)
    @app_commands.command(name="set-news-channel", description='Specify which channel the bot announces the patches/news')
    async def first_slash(self, interaction: discord.Interaction):
        await interaction.response.send_message(view=Select())
#

Why is it showing all of the channels instead of only text channels

balmy brook
#

thats not how u use channel select

tardy pelican
#

Oh what did I do wrong

balmy brook
#
class SelectMenu(discord.ui.ChannelSelect):
    def __init__(self):
        discord.ui.ChannelSelect(placeholder="Select an option", max_values=1, min_values=1, channel_types=[discord.ChannelType.text]) # this line here does nothing - i
        super().__init__() # u should put the options here the params


class Select(discord.ui.View):
    def __init__(self):
        super().__init__()
        self.add_item(SelectMenu()) # instead of subclassing u can also put in 'i' here
tardy pelican
#

So I should put the everything other the the placeholder inside of the init

tardy pelican
#

so if i understand right

#

i can do this_

#
class Select(discord.ui.View):
    def __init__(self):
        super().__init__()
        self.add_item(discord.ui.ChannelSelect(placeholder="Select an option", max_values=1, min_values=1, channel_types=[discord.ChannelType.text]))```
rich umbraBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.