#Pagination with buttons and embeds!
1 messages · Page 1 of 1 (latest)
Pull Request #1967: feat(interactivity): Add support for components in pages - VelvetToroyashi
🏷 use pr artifacts:
To run the library off a pull request, you will need a GitHub account. Navigate to the pull request you want to use and click on the green check mark next to the latest commit: https://cdn.discordapp.com/attachments/379379415475552276/1075485948281888788/image.png
Then, go to "Details" and scroll all the way down to "Artifacts". Download the zip file and extract it into a folder of your choice.
Now, you need to add the packages to your project.
Using CLI:
Run dotnet add package <package-name> --source "path/to/your/package/folder"
Using Visual Studio:
Add your local folder as a package source in this dialog, reached through the little gear icon in your NuGet dialogue, see https://cdn.discordapp.com/attachments/959804202744422453/962070642432311366/unknown.png and https://cdn.discordapp.com/attachments/959804202744422453/962070737148051536/unknown.png. You'll want to click the plus icon to create a new package source, then enter your folder name at "Source".
Using your .csproj file:
(do not.)
Add <RestoreAdditionalPackageSources>path/to/your/package/folder</RestoreAdditionalPackageSources> to your head PropertyGroup.
In the latter two cases, you should then be able to update D#+ to the pull request build through your NuGet dialogue.
ping
thanks!
wait, okay but how would i use that, could you give me some examples? in code
install DSP.interacitvity if you havent and then theres a SendPaginatedMessage method on DiscordChannel
ou okay
https://dsharpplus.github.io/DSharpPlus/articles/interactivity.html#enabling-interactivity
if you havent used interactivity yet
i seee
thanks
hmm
i dont think this will be useful for me, as fetching each page is an asynchronous operation, and i do not know how many pages there may be ahead of time, so passing an IEnumerable<Page> just wont be a solution for me, i think i may have to implement pagination myself, with buttons and so on
Lets say I have this method to fetch each page
static async Task<IEnumerable<Item>> FetchItems(int page)
{
var query = new GetAllItemsQuery(page, 5);
return await mediator.Send(query);
}
Well our paginator enumerates it when you send the message so still not really functions
i have plans to rework our pagination
thats gooooddd ill take a look at the current implementation and make something, ill share it with you
oh i have started my rework and im explicitly not looking at the old one 