Discord PAGINATION: All You Need to Know

Sdílet
Vložit
  • čas přidán 3. 12. 2022
  • In this video, implement a pagination effect with buttons on simple embeds in discordpy2
    🗃️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 • 20

  • @jasondotjson34
    @jasondotjson34 Před rokem +1

    Thanks for that! It's very easy to understand! Have a nice day! :)

  • @bobeponge7201
    @bobeponge7201 Před rokem

    Thanks for your jobs
    I do little modification to use your paginator with slash command and it's work well.

  • @TheGimpGrindTV
    @TheGimpGrindTV Před 8 měsíci

    Question: Say I wanted to have a bot that generates an embed when a command is invoked by the server owner. This embed includes a button below it & tells users to hit said button to select a number, which opens a modal for them to enter their number and press submit. The embed then updates with a list of who called a number & what number they called(the user gets added when they hit submit).
    When using pagination for the list of called numbers, does the page number (and data displayed on that page) change for everyone seeing it or just the person who hit the next page button?
    Apologies if that's a confusingly worded question. I can elaborate if need be.

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

    I dont understand how can i put the contents i want in the embeds? It is with the variables "until_item" and "from_item"?

  • @HrkeksRapid500mg
    @HrkeksRapid500mg Před rokem +5

    Calculating the number of pages with int(len(self.data) / self.sep) + 1
    works only when len(self.data) isn't a multiple of self.sep
    so math.ceil(len(self.data) / self.sep) seems like a better solution
    Excellent video otherwise, your tutorials really helped!👍

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

      Great solution, reminder that implementing this solution will break the buttons for empty lists since
      math.ceil(len(self.data['fields']) / self.sep) is 0, self.current_page will be 1 which allowing viewing of infinite empty pages like this: 0/0, 1/0, 2/0, etc.
      To fix just update the check to "self.current_page >= math.ceil(...)

  • @zingthe64savage18
    @zingthe64savage18 Před 8 měsíci

    "unresolved attribute reference 'data'"
    and when i run it I get:
    "attribute error: 'NoneType' object has no attribute 'edit"
    help...

  • @Kaygoooo
    @Kaygoooo Před rokem

    How can i add persistent view to these buttons?

  • @acomputernerd3505
    @acomputernerd3505 Před rokem

    Awesome video! Is there any way to implement a ‘jump to page _” function? Let’s say I stead of clicking a button 70 times to get to page 70, I can just press the “jump to” button and input ‘70’..

    • @YashDhankhar56
      @YashDhankhar56 Před 10 měsíci

      Make a modal button and then take input from that

  • @yoruismyhubby
    @yoruismyhubby Před rokem

    I'm confused. Do we need to use programs like Visual studio for this?? Thanks.

  • @mftrill
    @mftrill Před rokem

    what if we're trying to do this with an app_command?

    • @bobeponge7201
      @bobeponge7201 Před rokem

      you have to pass the interaction from the slash command to the class. I do this in the constructor.
      Then in the send method you have to use interaction.reponse.defer() whit interaction.followup.send (you have to put this in variable)
      And in the method update_message, reuse the variable contening the followup like: var.edit(your content)

    • @lawliet933
      @lawliet933 Před rokem

      @@bobeponge7201 could you elaborate more?
      Edit- i figured it out tysm for the help mate!

  • @almuaz
    @almuaz Před rokem

    thanks. thanks. thanks. thanks. thanks. thanks

  • @joelthbej8509
    @joelthbej8509 Před rokem

    Can you make a 24/7 tutorial?

    • @richardschwabe
      @richardschwabe  Před rokem +1

      Are you talking about the music bot 24/7 ? I have already made a video how to make a music bot with discordpy, its in the playlist