New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginator creates pages longer than maxlen when lines longer than maxlen are added. #340

Closed
max-kamps opened this Issue Sep 26, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@max-kamps
Contributor

max-kamps commented Sep 26, 2016

>>> from discord.ext import commands                               
>>> pag = commands.Paginator()             
>>> pag.add_line('x'*2000)                 
>>> pag.pages                              
['```\n```', '```\nxxxxx...xxxxxxx```']
>>> len(pag.pages[1])                      
2008                                                                                     

Possible solutions:

  • Raise exception
  • Split lines that are too long
  • use textwrap

@Rapptz Rapptz added the bug label Sep 26, 2016

@Rapptz

This comment has been minimized.

Owner

Rapptz commented Sep 27, 2016

I'll raise an exception (RuntimeError) for now just to deal with this edge case. That way the user can handle it however they want (e.g. splitting at specific points etc) instead of making me do the opinionated choice.

@Rapptz Rapptz closed this in 7c0be1c Sep 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment