Paginated message help

Hey, is there a way to change the items of the pagination message? Ideally with the PaginationFieldMessageEmbed. The use case is I want to build up an inventory for a RPG and want separate categories (to be selected using SelectMenu) At a given time, only one type of category would be shown.. Is there a way to swap out the old items and replace with brand new ones?
8 Replies
Favna
Favna2y ago
Sapphire Framework
Class: PaginatedMessage | Sapphire
@sapphire/discord.js-utilities.PaginatedMessage
nyan
nyanOP2y ago
I meant more as there would be multiple paginatedMessage objects and if the user selects a new category, the whole message would be edited and replaced
Favna
Favna2y ago
Uh no we do not support that, I'm sorry.
nyan
nyanOP2y ago
Another question: is there a way to add a cooldown for button interactions?
Favna
Favna2y ago
there isnt. There is an open PR after which you can use sapphire interaction handlers instead of the action's run though so then you can reply to an interaction saying they need to wait and just don't process it further. You'll have to implement the rate limit yourself still. Not too dissimilar from https://www.sapphirejs.dev/docs/Guide/plugins/API/rate-limiting
Sapphire Framework
Applying rate limits to routes | Sapphire
When writing an API that is publicly available for consumption, it is often desirable to set a rate limit on your routes
KB
KB2y ago
As Favna said, it'll be possible if/when the PR is merged. For normal buttons, I've implemented it myself using RateLimitManager and decorators in an interaction handler. Example: https://github.com/KBot-discord/KBot/blob/4862ca8dff95b95363d24e33a70d294c1eb41599/apps/bot/src/lib/utilities/decorators.ts#L26 Actually, I guess you could throw that logic into the action's run but that could be repetitive.
nyan
nyanOP2y ago
kk one more.. question: how can i make a button disabled if its on the first page or last page? I assume this can be done via setting page specific actions but wondering if theres an easier solution
Favna
Favna2y ago
your assumption is correct @sam the update that KB mentioned has been released, see #Announcements
Want results from more Discord servers?
Add your server