From 7fde54050a28a69e6d283c38c6ba216766bc3601 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 15 Jun 2020 13:00:28 +0200 Subject: [PATCH] Avoid a blank overflow page when showing paginated cards (closes #171) --- PluralKit.Bot/Utils/ContextUtils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PluralKit.Bot/Utils/ContextUtils.cs b/PluralKit.Bot/Utils/ContextUtils.cs index 9c0067e1..ab7ca402 100644 --- a/PluralKit.Bot/Utils/ContextUtils.cs +++ b/PluralKit.Bot/Utils/ContextUtils.cs @@ -102,8 +102,8 @@ namespace PluralKit.Bot { var buffer = new List(); await using var enumerator = items.GetAsyncEnumerator(); - - var pageCount = (totalCount / itemsPerPage) + 1; + + var pageCount = (int) Math.Ceiling(totalCount / (double) itemsPerPage); async Task MakeEmbedForPage(int page) { var bufferedItemsNeeded = (page + 1) * itemsPerPage;