Browse Source

Move `primary_guild`'s type file into `user`'s as it was too small

pull/10211/head
blord0 4 weeks ago
parent
commit
5c696898d5
  1. 2
      discord/primary_guild.py
  2. 32
      discord/types/primary_guild.py
  3. 6
      discord/types/user.py
  4. 3
      discord/user.py

2
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

32
discord/types/primary_guild.py

@ -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]

6
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]

3
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__ = (

Loading…
Cancel
Save