From e495ed969ab1486ab4371b157005a742b82a684e Mon Sep 17 00:00:00 2001 From: yupix Date: Mon, 17 Apr 2023 11:42:45 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20note=E3=81=AE=E5=9E=8B=E3=82=92?= =?UTF-8?q?=E3=82=88=E3=82=8A=E3=82=88=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/types/note.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mipac/types/note.py b/mipac/types/note.py index bca13c6..e9dea18 100644 --- a/mipac/types/note.py +++ b/mipac/types/note.py @@ -54,24 +54,27 @@ class GeoPayload(TypedDict): speed: int | None -class INoteRequired(TypedDict): - id: str +class IPartialNote(TypedDict): created_at: str - text: str | None cw: str | None - user: ILiteUser - user_id: str - reply_id: str - renote_id: str - files: list[IDriveFile] file_ids: list[str] - visibility: Literal['public', 'home', 'followers', 'specified'] - reactions: dict[str, int] + files: list[IDriveFile] + id: str + reaction_acceptance: NotRequired[Literal['likeOnly', 'likeOnlyForRemote']] # v13 only + reaction_emojis: NotRequired[dict[str, str]] # v13 only + renote_id: str | None renote_count: int + reactions: dict[str, int] replies_count: int + reply_id: str | None + text: str | None + user: ILiteUser + user_id: str + visibility: Literal['public', 'home', 'followers', 'specified'] + tags: NotRequired[list[str]] # タグがついてないとbodyに存在しない -class INote(INoteRequired, total=False): +class INote(IPartialNote, total=False): """ note object """ @@ -86,8 +89,6 @@ class INote(INoteRequired, total=False): is_hidden: bool poll: IPoll emojis: list[ICustomEmojiLite] - reaction_emojis: dict[str, str] - reaction_acceptance: Literal['likeOnly', 'likeOnlyForRemote'] | None class ICreatedNote(TypedDict):