Giter Site home page Giter Site logo

Comments (20)

anselal avatar anselal commented on July 19, 2024 1

@MiyakoYakota

@bot.command()
async def paginate(ctx):
    embed1 = discord.Embed(color=ctx.author.color).add_field(name="Example", value="Page 1")
    embed2 = discord.Embed(color=ctx.author.color).add_field(name="Example", value="Page 2")
    embed3 = discord.Embed(color=ctx.author.color).add_field(name="Example", value="Page 3")
    paginator = DiscordUtils.Pagination.CustomEmbedPaginator(ctx)
    paginator.add_reaction('⏮️', "first")
    paginator.add_reaction('⏪', "back")
    paginator.add_reaction('🔐', "lock")
    paginator.add_reaction('⏩', "next")
    paginator.add_reaction('⏭️', "last")
    embeds = [embed1, embed2, embed3]
    await paginator.run(embeds)

from discordutils.

toxicrecker avatar toxicrecker commented on July 19, 2024 1

no error on the console. but the command did not return anything. maybe it has to do with bot permissions ? I already asked this but didn't get a serious response

Do you have an error handler that raises the errors for you?
in case you dont:

@bot.event
async def on_command_error(ctx, error):
    raise error

from discordutils.

anselal avatar anselal commented on July 19, 2024

More specific I tried the paginate commands

from discordutils.

toxicrecker avatar toxicrecker commented on July 19, 2024

It works for me

from discordutils.

anselal avatar anselal commented on July 19, 2024

Yeah, well, this ain't helping me. You build the library. Maybe some help here ?
Are there any special permissions my bot has to have ? I gave read/write and read history permissions, and reaction permisions

from discordutils.

MiyakoYakota avatar MiyakoYakota commented on July 19, 2024

Yeah, well, this ain't helping me. You build the library. Maybe some help here ?
Are there any special permissions my bot has to have ? I gave read/write and read history permissions, and reaction permisions

Just because you use someone's code does not mean you are entitled to support. Post your code, and pray some person with time on their hands will be willing to help you.

from discordutils.

anselal avatar anselal commented on July 19, 2024

Well, the code is taken from the examples as I already mentioned. Besides that, you 2 had the time being rude but haven't the time to help? This is an open source project isn't it? Shame on both of you @MiyakoYakota @toxicrecker

from discordutils.

MiyakoYakota avatar MiyakoYakota commented on July 19, 2024

Well, the code is taken from the examples as I already mentioned. Besides that, you 2 had the time being rude but haven't the time to help? This is an open source project isn't it? Shame on both of you @MiyakoYakota @toxicrecker

Again, post your code, and hope someone will help you.

from discordutils.

anselal avatar anselal commented on July 19, 2024

Again, my code is the Project's examples. Never mind

from discordutils.

MiyakoYakota avatar MiyakoYakota commented on July 19, 2024

Again, my code is the Project's examples. Never mind

The samples work fine. You are doing something wrong. Post your code, last time I will attempt.

from discordutils.

some-boi avatar some-boi commented on July 19, 2024

@MiyakoYakota

@bot.command()
async def paginate(ctx):
    embed1 = discord.Embed(color=ctx.author.color).add_field(name="Example", value="Page 1")
    embed2 = discord.Embed(color=ctx.author.color).add_field(name="Example", value="Page 2")
    embed3 = discord.Embed(color=ctx.author.color).add_field(name="Example", value="Page 3")
    paginator = DiscordUtils.Pagination.CustomEmbedPaginator(ctx)
    paginator.add_reaction('⏮️', "first")
    paginator.add_reaction('⏪', "back")
    paginator.add_reaction('🔐', "lock")
    paginator.add_reaction('⏩', "next")
    paginator.add_reaction('⏭️', "last")
    embeds = [embed1, embed2, embed3]
    await paginator.run(embeds)

Can you show us what error you had while using that code?

from discordutils.

anselal avatar anselal commented on July 19, 2024

no error on the console. but the command did not return anything. maybe it has to do with bot permissions ? I already asked this but didn't get a serious response

from discordutils.

some-boi avatar some-boi commented on July 19, 2024

no error on the console. but the command did not return anything. maybe it has to do with bot permissions ? I already asked this but didn't get a serious response

Then what permissions did your bot have? since it would need embed links permission to send the embed

from discordutils.

anand2312 avatar anand2312 commented on July 19, 2024

no error on the console. but the command did not return anything. maybe it has to do with bot permissions ? I already asked this but didn't get a serious response

Do you have an error handler that raises the errors for you?
in case you dont:

@bot.event
async def on_command_error(ctx, error):
    raise error

This is a rather useless error handler. If the user hasn't overridden the default provided on_command_error, and there was an error, it'd be printed to the console

The only way that errors would be getting suppressed would be if they had faulty error handler; one which handled only a few cases and silently ignored the rest, like:

@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, ...):
        # does something

And the correct way would be....

@bot.event
async def on_command_error(ctx, error):
    if isinstance(error, ...):
        # does something
    raise error  # this makes sure that you re-raise any errors that you weren't planning on handling

from discordutils.

JayDwee avatar JayDwee commented on July 19, 2024

Did you install all requirements for discord.py[voice]

$ sudo apt install libffi-dev python3-dev
$ pip3 install PyNaCl
$ pip3 install DiscordUtils

I have also put in a PR to remove this requirement #25 in which this issue (if it is what you're having) will no longer need those additional requirements

from discordutils.

anselal avatar anselal commented on July 19, 2024

I did not install pynacl nor libffi-dev

from discordutils.

JayDwee avatar JayDwee commented on July 19, 2024

I did not install pynacl nor libffi-dev

That'll be the issue 😄

You can either install those dependencies, or if you are unable to you can use my branch while waiting for #25 to be approved with

$ pip install git+https://github.com/KoalaBotUK/DiscordUtils

This will remove Music functionality, but others will work fine

glad to help 👍

from discordutils.

anselal avatar anselal commented on July 19, 2024

There is no reason to install a voice library to make a pagination work. I still think it is a permissions issue.

What permissions are required to make it work ?

from discordutils.

JayDwee avatar JayDwee commented on July 19, 2024

It's to do with the original import, when importing DiscordUtils it imports the Music class which will crash if discord[voice] is not successfully downloaded.

Please try the suggested fix and let us know if it solves your problem so this issue can be closed.

from discordutils.

JayDwee avatar JayDwee commented on July 19, 2024

@anselal DiscordUtils has been updated now so try installing with pip install DiscordUtils and let us know if your code starts working so this issue can be closed

from discordutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.