From 5c696898d59ee2c7496cb957b09a5b766727e42c Mon Sep 17 00:00:00 2001 From: blord0 Date: Thu, 19 Jun 2025 22:32:10 +0100 Subject: [PATCH] Move `primary_guild`'s type file into `user`'s as it was too small --- discord/primary_guild.py | 2 +- discord/types/primary_guild.py | 32 -------------------------------- discord/types/user.py | 6 ++++++ discord/user.py | 3 +-- 4 files changed, 8 insertions(+), 35 deletions(-) delete mode 100644 discord/types/primary_guild.py diff --git a/discord/primary_guild.py b/discord/primary_guild.py index 4d92d7a2a..1c986636e 100644 --- a/discord/primary_guild.py +++ b/discord/primary_guild.py @@ -32,7 +32,7 @@ from .utils import snowflake_time, _get_as_snowflake if TYPE_CHECKING: from .state import ConnectionState - from .types.primary_guild import PrimaryGuild as PrimaryGuildPayload + from .types.user import PrimaryGuild as PrimaryGuildPayload from typing_extensions import Self diff --git a/discord/types/primary_guild.py b/discord/types/primary_guild.py deleted file mode 100644 index ad8a7c338..000000000 --- a/discord/types/primary_guild.py +++ /dev/null @@ -1,32 +0,0 @@ -""" -The MIT License (MIT) - -Copyright (c) 2015-present Rapptz - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -""" - -from typing import TypedDict, Optional - - -class PrimaryGuild(TypedDict): - identity_guild_id: Optional[int] - identity_enabled: Optional[bool] - tag: Optional[str] - badge: Optional[str] diff --git a/discord/types/user.py b/discord/types/user.py index 1f027ce9d..b6bcc12a0 100644 --- a/discord/types/user.py +++ b/discord/types/user.py @@ -54,3 +54,9 @@ class User(PartialUser, total=False): flags: int premium_type: PremiumType public_flags: int + +class PrimaryGuild(TypedDict): + identity_guild_id: Optional[int] + identity_enabled: Optional[bool] + tag: Optional[str] + badge: Optional[str] \ No newline at end of file diff --git a/discord/user.py b/discord/user.py index 4bd2ac21d..e06db763f 100644 --- a/discord/user.py +++ b/discord/user.py @@ -43,9 +43,8 @@ if TYPE_CHECKING: from .guild import Guild from .message import Message from .state import ConnectionState - from .types.primary_guild import PrimaryGuild as PrimaryGuildPayload from .types.channel import DMChannel as DMChannelPayload - from .types.user import PartialUser as PartialUserPayload, User as UserPayload, AvatarDecorationData + from .types.user import PartialUser as PartialUserPayload, User as UserPayload, AvatarDecorationData, PrimaryGuild as PrimaryGuildPayload __all__ = (