From 4f965fe1e62f3142acde30e662446c0d685eaf31 Mon Sep 17 00:00:00 2001 From: yupix Date: Tue, 18 Jun 2024 17:34:16 +0900 Subject: [PATCH] =?UTF-8?q?feat!:=20ClientReactionActions=E3=81=AE?= =?UTF-8?q?=E5=AF=BE=E8=B1=A1=E3=81=AEID=E3=82=92=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=BC=95=E6=95=B0=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20#140?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/actions/reaction.py | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/mipac/actions/reaction.py b/mipac/actions/reaction.py index 452cccca..8f5e9484 100644 --- a/mipac/actions/reaction.py +++ b/mipac/actions/reaction.py @@ -110,7 +110,7 @@ def __init__(self, note_id: str, *, session: HTTPClient, client: ClientManager) self.__note_id: str = note_id @override - async def add(self, reaction: str, *, note_id: str | None = None) -> bool: + async def add(self, reaction: str) -> bool: """Add reaction to note Endpoint: `/api/notes/reactions/create` @@ -119,37 +119,26 @@ async def add(self, reaction: str, *, note_id: str | None = None) -> bool: ---------- reaction : str reaction - note_id : str, optional - note id, by default None Returns ------- bool success or not """ - note_id = note_id or self.__note_id - - return await super().add(reaction=reaction, note_id=note_id) + return await super().add(reaction=reaction, note_id=self.__note_id) @override - async def remove(self, *, note_id: str | None = None) -> bool: + async def remove(self) -> bool: """Remove reaction from note Endpoint: `/api/notes/reactions/delete` - Parameters - ---------- - note_id : str, optional - note id, by default None - Returns ------- bool success or not """ - note_id = note_id or self.__note_id - - return await super().remove(note_id=note_id) + return await super().remove(note_id=self.__note_id) @override async def get_reactions( @@ -158,13 +147,9 @@ async def get_reactions( limit: int = 10, since_id: str | None = None, until_id: str | None = None, - *, - note_id: str | None = None, ) -> list[NoteReaction]: - note_id = note_id or self.__note_id - return await super().get_reactions( - type=type, note_id=note_id, limit=limit, since_id=since_id, until_id=until_id + type=type, note_id=self.__note_id, limit=limit, since_id=since_id, until_id=until_id ) @override @@ -174,13 +159,9 @@ async def fetch_reactions( limit: int = 10, since_id: str | None = None, until_id: str | None = None, - *, - note_id: str | None = None, ) -> list[NoteReaction]: - note_id = note_id or self.__note_id - return await super().fetch_reactions( - type=type, note_id=note_id, limit=limit, since_id=since_id, until_id=until_id + type=type, note_id=self.__note_id, limit=limit, since_id=since_id, until_id=until_id )