.waifugift pagination fixed - maximum number of pages properly scales with the number of items

This commit is contained in:
Kwoth
2021-09-16 18:59:03 +02:00
parent d2d0cb9e03
commit 2a1f45819d
2 changed files with 3 additions and 1 deletions

View File

@@ -10,6 +10,8 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.
- Timer should no longer increase on some repeaters - Timer should no longer increase on some repeaters
- Repeaters should no longer have periods when they're missing from the list - Repeaters should no longer have periods when they're missing from the list
## [3.0.3] - 15.09.2021 ## [3.0.3] - 15.09.2021
### Added ### Added

View File

@@ -306,7 +306,7 @@ namespace NadekoBot.Modules.Gambling
[Priority(1)] [Priority(1)]
public async Task WaifuGift(int page = 1) public async Task WaifuGift(int page = 1)
{ {
if (--page < 0 || page > 3) if (--page < 0 || page > (_config.Waifu.Items.Count - 1) / 9)
return; return;
var waifuItems = _service.GetWaifuItems(); var waifuItems = _service.GetWaifuItems();