How to Look for Players in Discord with Python and Discordpy

Sdílet
Vložit
  • čas přidán 13. 06. 2024
  • In this video we create a looking for players command. The user can choose a game and define how many people they are looking for. Others can then interact with an embed and buttons.
    We are using Slashcommands in Discord to choose the games. If you want autocomplete you can check out the autocomplete example from the Playlist.
    🗃️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!
    This video might have a related article on my website: www.richardschwabe.de
    My patreon for the super subscribers: / richardschwabe
    Some affiliate links (I will receive a small commission on Amazon) to support the channel at no extra cost for you:
    📚Favorite Books📚
    geni.us/rOy8L
    geni.us/om4z
    geni.us/1l9fKhZ
    geni.us/TpZ1
    geni.us/AbYnW
    🖥️PC Setup🖥️
    Duronic Triple Monitor Arm Stand: geni.us/tQVdeC
    TeckNet Extended Gaming Mouse Pad: geni.us/o12vH0U
    Razer DeathAdder V2: geni.us/N4tP1
    Logitech C920 HD Pro Webcam: geni.us/YlBt8N2
    Dell U2722D UltraSharp 27: geni.us/IkBOd
    Dell S2721DGFA 27 Inch QHD: geni.us/nSmy9
    Beyerdynamic DT 770 PRO: geni.us/i6JR
    ✨Recording✨
    Rode Procaster: geni.us/MU3ua6h
    Elgato Green Screen: geni.us/BhecX
    STEINBERG UR242: geni.us/ltBdFP
    Elgato Stream Deck Classic: geni.us/koiy5
    🖧Network🖧
    Ubiquiti UniFi SmartPower Redundant: geni.us/wIG3U3
    Ubiquiti UniFi Dream Machine Pro: geni.us/75zJ9BI
    Ubiquiti Networks etc-24-poe: geni.us/hFNiuc
    Ubiquiti UniFi 6 Long-Range: geni.us/GTy23S
    © 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 • 11

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

    This was very well explained. Helped a lot, thanks for sharing.

  • @Junnnn___
    @Junnnn___ Před rokem +2

    Hey there! I need some of your help with this. How could I "bring together" or import all the different files from the course, commands, cogs, etc and execute the bot in a way that has all those features. I know this might be a newbie question but I just started learning how to code a couple of weeks ago.

    • @richardschwabe
      @richardschwabe  Před rokem +1

      That sounds like a good project to learn programming. Create yourself a project structure, that could follow the approach of the Cogs, including the autoloading from the Cog videos. Meaning you create a cogs folder, have your main.py and settings file and then start working on various Cog files. For additional "stand alone tasks" you could follow the cmds folder structure. Make use of the extension system of discordpy. In the cog files you then simply "copy paste" the command examples that you want to use. This would be a good start point.
      However, keep in mind, that a lot of the code in the videos does no permission checking, error handling or respects special use cases. The code is focused on the exact problem / topic of the video and lacks "production ready code". So you will need to do a lot more work to get it to the point you will be happy with.
      However, learning programming in general is best done with having projects, as the challenges along that way will lead you to a structured research process. Enjoy :)

  • @joelthbej8509
    @joelthbej8509 Před rokem +1

    hello i love your vids but was wondering if you could make a tutorial for making a bot able to google search things

    • @richardschwabe
      @richardschwabe  Před rokem

      Google is not very friendly in that regards. But a work around is using a get request for letmegooglethat.com and simply supply a url formatted string for the >q< parameter.

  • @ammadali5799
    @ammadali5799 Před rokem +2

    maybe ticket system next?

  • @iTwiti
    @iTwiti Před rokem +1

    hello,
    is there any way to make a "optional hidden choice" in slash command? I mean for example if I make a report command and I have typing.Literal variable with "report server bug, report command bug, report person" and I want to have possibility to add person:discord.Member to this and then report text. I know my quesstion is a little confusing to understand but maybe this two lines under will explain my question.
    if I chose other bugs: /report [choice:bug server] [text]
    async def report(interaction:discord.Interaction, choice:Literal["server bug","command bug","person"], text:str):
    or If I chose person: /report [person] [chose_a_person] [text]
    async def report(interaction:discord.Interaction, choice:Literal["server bug","command bug","person"], person:discord.Member, text:str):
    so if I choice a person it schows me another line with person to chose, otherwise it doesn't
    thank u very much, your videos are very helpful to me and I can't wait to see more of it! ^^
    happy new year!

    • @richardschwabe
      @richardschwabe  Před rokem +1

      Happy New Year!
      I have not tested this, but I think it should not be possible. From what I understand you want to have a dynamic choice based on a previous selection in the command. I think that is not possible because I am not aware of a direct callback, based on the first parameter that a user selects. Therefore we should not be able to change the command prompt.
      However, this sounds like a good use case for forms. Because you can interact on a dropdown (select) in a modal and see what the person chose. From there you could adjust the modal.

    • @iTwiti
      @iTwiti Před rokem

      @@richardschwabe yes, that was my question, so I have to reject discord.Member in my command and maybe I'm gonna try this in dropdown menu like u said, thank you very much for your answer :D

  • @mr.electron5295
    @mr.electron5295 Před rokem

    Halo sir i have few things to ask you regarding a dream game bot project i wana make how can i contact u on discord sir