How to create dropdown menus for a discord bot in python (discordpy)

Sdílet
Vložit
  • čas přidán 4. 11. 2022
  • In this video, we're going to show you how to use Discordpy Select to create simple surveys that you can use to understand your users better.
    By using Discordpy Select, you can quickly and easily collect data about your users' preferences and behavior. This information can be used to improve your Discord server and make your users happy!
    🔗 URLs 🔗
    - discordpy.readthedocs.io/en/s...
    🗃️Github Project URL🗃️
    - github.com/richardschwabe/dis...
    🏆About this course🏆
    My updated course: "How to make a discord bot" with discord.py 2.x covers everything you need to know to raise productivity and user activity on your discord server. By following this course you will learn everything you need to create a successful bot. Resulting in a professional, community driven and feature rich successful discord server.
    The initial videos cover all necessary elements to create anything you want with discordpy, this includes:
    - Registering a discord bot and inviting it to your server
    - Setting up the python project with extra logging functionality
    - Introduction to basic discordpy bot command structure
    - Automatically load bot commands from separate files
    - Handling user input with discordpy converters in a bot instance
    - Handling errors during command execution
    - Grouping commands together for better command organisation
    - Creating discordpy COG (command collections)
    - Loading COG extensions automatically from files
    - Creating checks to limit access on bot commands
    - DMs & "only you can see this" messages
    - Hybrid commands to have both custom bot commands but also "SlashCommands"
    - Dedicated Slashcommands
    - Application commands in context menus for Members and Messages
    - Decorators for Slashcommands
    - Transform any user input in Slashcommands
    - Handling autocompletion and filtering of Slashcommand user input
    - Send rich text embeds with pictures, links and tables
    - Create Views with Buttons for even better user interactions
    - Showing Modals with Selects, TextInputs and Buttons
    🎥Playlist 🎥
    • How to create a DISCOR...
    ❤Community❤
    To support the channel and see more tutorials about technologies:
    👉LIKE & SUBSCRIBE to the channel:
    czcams.com/users/subscription_c...
    👉Join us on our discord server: / discord
    🌲My Linktr.ee 🌲
    linktr.ee/richardschwabe
    🗃️Code to my videos can be found on Github: github.com/richardschwabe
    👉Comment below the video for feedback, suggestions, wishes or if you have spotted a mistake!
    🏷️ Tags 🏷️
    how to make a discord bot,python tutorial,discord bot,discord music bot,python discord bot,discord bot maker,discord py,best discord bots 2022,discordpy,discord bot client,create discord bot python,slash commands discord.py,discord py 2.0,create slash commands discord.py,discord.py slash commands,discordpy cogs,discord.py buttons, discord.py tutorial, discord.py tutorial 2023
    © Created by Richard Schwabe with ❤ ©
    Music License: CZcams Audio Library
    Website: www.richardschwabe.de
    All code examples fall under GNU General Public License v3.0
    We do not recommend using code shown in tutorials or on our Github public repository to run in production environment and should be used for education only.
    We cannot be held liable for any damage caused by the code or do not provide any warranty.
  • Věda a technologie

Komentáře • 10

  • @fally_UI
    @fally_UI Před 5 měsíci

    Why this error may appear: TypeError: View.__init__() got an unexpected keyword argument 'options'

  • @pepsi3168
    @pepsi3168 Před měsícem

    theres no need to defer the interaction, you could just respond to it with await interaction.response.edit_message()

  • @Raxor08
    @Raxor08 Před rokem +3

    Thank you for your great video!
    I load my options from a database.
    I also have a command to add new options in this database. However, the new options are only displayed in the dropdown after restarting the bot .
    Is there a way to reload the dropdown?

    • @zack_nap
      @zack_nap Před rokem

      while True:
      ctx.edit_original_message(view=view)
      This code will update the view Non stop

    • @mr_baconhat
      @mr_baconhat Před měsícem

      @@zack_nap no. that will not because changes written in code will not be detected by ctx.edit. you will always have to restart the bot. thats the only way

    • @zack_nap
      @zack_nap Před měsícem

      no, it works for me@@mr_baconhat

    • @rexi...
      @rexi... Před měsícem

      @@mr_baconhat not true, persistent views

  • @MrChopptr
    @MrChopptr Před 7 dny

    this no longer works

  • @_Astro.Nish_
    @_Astro.Nish_ Před rokem +2

    These are such confusing steps that you are teaching and very bad examples. I mean everything is just hardcoded, there is no dynamism in it. What if I want third dropdown? do I need to keep 3rd one in 2nd one's class (which itself is in 1st one's dependency) and then make everything so messy ?

    • @robbiewinfield7853
      @robbiewinfield7853 Před 10 měsíci +1

      Honestly, just make a new class for each menu. Have the command create an instance of the first menu. The first menu calls the 2nd menu once the selections are made, the 2nd calls the 3rd, etc. And to get all the selected options at the end, just be sure to pass in a list of previously selected options into each new class and append the new selections.