From 5ecc256969748fff701c28b055900bf3967ebb2b Mon Sep 17 00:00:00 2001 From: yupix Date: Sun, 18 Aug 2024 23:53:14 +0900 Subject: [PATCH] =?UTF-8?q?feat!:=20=E6=9C=AC=E6=9D=A5v0.7.0=E3=81=A7?= =?UTF-8?q?=E6=B6=88=E3=81=99=E4=BA=88=E5=AE=9A=E3=81=AE=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=82=92=E6=B6=88=E3=81=97=E5=BF=98=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4=20close?= =?UTF-8?q?=20#100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mipac/models/user.py | 30 +----------------------------- mipac/types/user.py | 14 -------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/mipac/models/user.py b/mipac/models/user.py index e241fe46..fc4badca 100644 --- a/mipac/models/user.py +++ b/mipac/models/user.py @@ -5,7 +5,7 @@ from mipac.models.announcement import Announcement from mipac.models.lite.role import PartialRole -from mipac.models.lite.user import BadgeRole, PartialUser +from mipac.models.lite.user import PartialUser from mipac.models.note import Note from mipac.types.follow import IFederationFollowCommon, IFederationFollower, IFederationFollowing from mipac.types.meta import IPolicies @@ -26,14 +26,12 @@ IUserList, IUserListMembership, IUserNotify, - IUserRole, IUserSecurityKey, NotificationRecieveConfig, is_me_detailed, is_user_detailed_not_me, ) from mipac.utils.format import str_to_datetime -from mipac.utils.util import DeprecatedClass if TYPE_CHECKING: from mipac.manager.client import ClientManager @@ -137,32 +135,6 @@ def _get(self, key: str) -> Any | None: return self._raw_user_field.get(key) -@DeprecatedClass(remove_in_version="0.7.0") -class UserRole(BadgeRole[IUserRole]): - def __init__(self, data: IUserRole, *, client: ClientManager) -> None: - super().__init__(data, client=client) - - @property - def id(self) -> str: - return self._data["id"] - - @property - def color(self) -> str | None: - return self._data["color"] - - @property - def description(self) -> str: - return self._data["description"] - - @property - def is_moderator(self) -> bool: - return self._data["is_moderator"] - - @property - def is_administrator(self) -> bool: - return self._data["is_administrator"] - - class UserDetailedNotMeOnly: def __init__(self, raw_user: IUserDetailedNotMeOnlySchema, *, client: ClientManager) -> None: self._raw_user: IUserDetailedNotMeOnlySchema = raw_user diff --git a/mipac/types/user.py b/mipac/types/user.py index 0aee9946..9267ffea 100644 --- a/mipac/types/user.py +++ b/mipac/types/user.py @@ -46,20 +46,6 @@ class IBadgeRole(TypedDict): display_order: int -class IUserRole(IBadgeRole): - """ - Deprecated - - Will be removed in v0.7.0 - """ - - id: str - color: str | None - description: str - is_moderator: bool - is_administrator: bool - - class IUserRequired(TypedDict): id: str username: str