diff --git a/mipac/actions/note.py b/mipac/actions/note.py index 5ab7b94..e62bd5d 100644 --- a/mipac/actions/note.py +++ b/mipac/actions/note.py @@ -1042,11 +1042,50 @@ class NoteActions(ClientNoteActions): "sinceDate": since_date, "untilDate": until_date, } - + res = await self._session.request( Route("POST", "/api/notes/local-timeline"), json=data, auth=True ) - + + return [Note(note, client=self._client) for note in res] + + async def get_mentions( + self, + following: bool = False, + limit: int = 10, + since_id: str | None = None, + until_id: str | None = None, + visibility: INoteVisibility = "public", + ): + """Get notes with mentions addressed to you + + Endpoint: `/api/notes/mentions` + + Parameters + ---------- + following : bool, default=False + Whether to include only users you follow + limit : int, default=10 + limit + since_id : str | None, default=None + Since ID + until_id : str | None, default=None + Until ID + visibility : INoteVisibility, default='public' + Disclosure range + """ + data = { + "following": following, + "limit": limit, + "sinceId": since_id, + "untilId": until_id, + "visibility": visibility, + } + + res: list[INote] = await self._session.request( + Route("POST", "/api/notes/mentions"), json=data, auth=True + ) + return [Note(note, client=self._client) for note in res] @deprecated @@ -1230,45 +1269,6 @@ class NoteActions(ClientNoteActions): if get_all is False or pagination.is_final: break - async def get_mentions( - self, - following: bool = False, - limit: int = 10, - since_id: str | None = None, - until_id: str | None = None, - visibility: INoteVisibility = "public", - ): - """Get notes with mentions addressed to you - - Endpoint: `/api/notes/mentions` - - Parameters - ---------- - following : bool, default=False - Whether to include only users you follow - limit : int, default=10 - limit - since_id : str | None, default=None - Since ID - until_id : str | None, default=None - Until ID - visibility : INoteVisibility, default='public' - Disclosure range - """ - data = { - "following": following, - "limit": limit, - "sinceId": since_id, - "untilId": until_id, - "visibility": visibility, - } - - res: list[INote] = await self._session.request( - Route("POST", "/api/notes/mentions"), json=data, auth=True - ) - - return [Note(note, client=self._client) for note in res] - async def get_time_line( self, list_id: str, diff --git a/mipac/manager/favorite.py b/mipac/manager/favorite.py index 7698dbf..ee48b36 100644 --- a/mipac/manager/favorite.py +++ b/mipac/manager/favorite.py @@ -9,12 +9,13 @@ from mipac.http import HTTPClient if TYPE_CHECKING: from mipac.client import ClientManager + class ClientFavoriteManager(AbstractManager): def __init__(self, note_id: str, *, session: HTTPClient, client: ClientManager): self.__note_id = note_id self.__session: HTTPClient = session self.__client: ClientManager = client - + @property def action(self) -> ClientFavoriteActions: """お気に入りに関するアクション @@ -29,7 +30,7 @@ class ClientFavoriteManager(AbstractManager): session=self.__session, client=self.__client, ) - + class FavoriteManager(AbstractManager): def __init__(self, note_id: str | None = None, *, session: HTTPClient, client: ClientManager):