From 000274c29d2d433b8da97f149f2231e95c20282d Mon Sep 17 00:00:00 2001 From: omame Date: Sat, 17 Dec 2022 18:32:38 +0100 Subject: [PATCH] fix(api): using count without start results in pagination not working --- bob/__init__.py | 2 +- cogs/webapi.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bob/__init__.py b/bob/__init__.py index 484671b..4772c8f 100644 --- a/bob/__init__.py +++ b/bob/__init__.py @@ -1,7 +1,7 @@ """ Constants used by bob. """ -__version__ = "2.7.3" +__version__ = "2.7.4" import random diff --git a/cogs/webapi.py b/cogs/webapi.py index 8ec8194..9085960 100644 --- a/cogs/webapi.py +++ b/cogs/webapi.py @@ -95,7 +95,7 @@ def question_list(): questions = {i: q for i, q in questions.items() for r in q["responses"] if response_search in r["text"]} start = int(start) if start else None count = int(count) if count else None - end = start + count if start is not None and count is not None else None + end = start + count if start is not None and count is not None else count questions = {i: q for i, q in list(questions.items())[start:end]} return questions