From 1a578153a2271b5e8cc45a673acd79aea571d55e Mon Sep 17 00:00:00 2001 From: yupix Date: Fri, 2 Feb 2024 22:20:57 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20antennas/create=E3=81=AE=E5=BC=95?= =?UTF-8?q?=E6=95=B0=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/actions/antenna.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mipac/actions/antenna.py b/mipac/actions/antenna.py index f343557..7c107bb 100644 --- a/mipac/actions/antenna.py +++ b/mipac/actions/antenna.py @@ -9,8 +9,9 @@ from mipac.models.antenna import Antenna from mipac.models.note import Note from mipac.types.antenna import IAntenna, IAntennaReceiveSource from mipac.types.note import INote -from mipac.utils.format import remove_dict_empty +from mipac.utils.format import remove_dict_empty, remove_dict_missing from mipac.utils.pagination import Pagination +from mipac.utils.util import MISSING if TYPE_CHECKING: from mipac.client import ClientManager @@ -216,6 +217,7 @@ class AntennaActions(ClientAntennaActions): exclude_keywords: list[list[str]] | None = None, users: list[str] | None = None, case_sensitive: bool = False, + local_only: bool = MISSING, with_replies: bool = False, with_file: bool = False, notify: bool = False, @@ -233,6 +235,8 @@ class AntennaActions(ClientAntennaActions): Receive keywords. exclude_keywords : list[list[str]] | None, default None Excluded keywords. + local_only : bool, default MISSING + Whether to limit to local notes. users : list[str] | None, default None List of target user ID. Required when selecting 'users' as the receive source. case_sensitive : bool, default False @@ -268,7 +272,7 @@ class AntennaActions(ClientAntennaActions): is False ): raise ParameterError("Required parameters are missing") - body = { + body = remove_dict_missing({ "name": name, "src": src, "userListId": user_list_id, @@ -276,10 +280,11 @@ class AntennaActions(ClientAntennaActions): "excludeKeywords": exclude_keywords, "users": users, "caseSensitive": case_sensitive, + "localOnly": local_only, "withReplies": with_replies, "withFile": with_file, "notify": notify, - } + }) res_antenna: IAntenna = await self._session.request( Route("POST", "/api/antennas/create"), auth=True, json=body, remove_none=False