Implement custom pagination for Sentinel history embeds #78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now, with ~14,500 moderations in the database for a single guild, it takes about ~35 seconds to query the database and do other related actions with those objects once they're loaded into Python.
What currently is done:
discord.Embedinstance for everypagesizemoderations in the list, performing extensive string manipulation.SimpleMenuand sends it to the user. This menu allows the user to click through each page.A lot of this could be, and should be, done lazily. We don't need to be building thousands of pages when the user will realistically only look at a small number of pages, if they look at any at all. Instead, we should do a fresh database query each time the page is changed by the user.
Proposal:
<pagesize>moderations that satisfy the given filters.COUNTquery with identical filters to the first. This number is then rendered in embeds and also used to validate pagination logic.