From a77cc5ca8aed8b818643b9df5e0f0cdf8d328713 Mon Sep 17 00:00:00 2001 From: yupix Date: Thu, 24 Nov 2022 22:35:14 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20limit=E3=81=8C100=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E3=81=A0=E3=81=A3=E3=81=9F=E5=A0=B4=E5=90=88=E4=BE=8B=E5=A4=96?= =?UTF-8?q?=E3=82=92=E8=BF=94=E3=81=99=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/actions/note.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mipac/actions/note.py b/mipac/actions/note.py index e66640a..a147e19 100644 --- a/mipac/actions/note.py +++ b/mipac/actions/note.py @@ -366,6 +366,10 @@ class NoteActions: *, all: bool = False ) -> AsyncIterator[Note]: + + if (limit > 100): + raise ParameterError('limit は100以下である必要があります') + async def request(body) -> list[Note]: res: list[INote] = await self.__session.request( Route('POST', '/api/notes'), lower=True, auth=True, json=body @@ -396,7 +400,7 @@ class NoteActions: body['untilId'] = first_req[-1].id while True: res = await request(body) - if len(res) != 100: + if len(res) <= 100: for note in res: yield note if len(res) == 0: