From a5694803abd0749b18b1a9079676934ca28d3515 Mon Sep 17 00:00:00 2001 From: yupix Date: Sat, 6 Jan 2024 15:11:32 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20notes/featured=20=E3=82=92=E3=82=B5?= =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/actions/note.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/mipac/actions/note.py b/mipac/actions/note.py index 654db46..21ead9c 100644 --- a/mipac/actions/note.py +++ b/mipac/actions/note.py @@ -910,6 +910,32 @@ class NoteActions(ClientNoteActions): async def delete(self, note_id: str) -> bool: return await super().delete(note_id=note_id) + async def get_featured(self, limit: int = 10, until_id: str | None = None, channel_id: str | None = None): + """Get featured notes + + Endpoint: `/api/notes/featured` + + Parameters + ---------- + limit : int, default=10 + limit + until_id : str | None, default=None + Until ID + channel_id : str | None, default=None + channel id + + Returns + ------- + list[Note] + featured notes + """ + data = {"limit": limit, "untilId": until_id, "channelId": channel_id} + res: list[INote] = await self._session.request( + Route("POST", "/api/notes/featured"), json=data + ) + return [Note(note, client=self._client) for note in res] + + @deprecated async def send( self,