From f960742d9edddc1de0ef4fd0cefa380df21e472d Mon Sep 17 00:00:00 2001 From: yupix Date: Wed, 29 Nov 2023 11:52:53 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20get=5Fmentions=E3=83=A1=E3=82=BD?= =?UTF-8?q?=E3=83=83=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/actions/note.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/mipac/actions/note.py b/mipac/actions/note.py index c995a26..9bcebeb 100644 --- a/mipac/actions/note.py +++ b/mipac/actions/note.py @@ -969,3 +969,42 @@ class NoteActions(ClientNoteActions): yield Note(note, client=self._client) 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]