mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 07:26:17 +00:00
[types] Use PEP-655 style Required/NotRequired types
This commit is contained in:
parent
b1878224f2
commit
d600436378
@ -1306,7 +1306,7 @@ class HTTPClient:
|
|||||||
self,
|
self,
|
||||||
guild_id: Snowflake,
|
guild_id: Snowflake,
|
||||||
sticker_id: Snowflake,
|
sticker_id: Snowflake,
|
||||||
payload: sticker.EditGuildSticker,
|
payload: Dict[str, Any],
|
||||||
reason: Optional[str],
|
reason: Optional[str],
|
||||||
) -> Response[sticker.GuildSticker]:
|
) -> Response[sticker.GuildSticker]:
|
||||||
return self.request(
|
return self.request(
|
||||||
|
@ -52,7 +52,6 @@ if TYPE_CHECKING:
|
|||||||
StandardSticker as StandardStickerPayload,
|
StandardSticker as StandardStickerPayload,
|
||||||
GuildSticker as GuildStickerPayload,
|
GuildSticker as GuildStickerPayload,
|
||||||
ListPremiumStickerPacks as ListPremiumStickerPacksPayload,
|
ListPremiumStickerPacks as ListPremiumStickerPacksPayload,
|
||||||
EditGuildSticker,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -469,7 +468,7 @@ class GuildSticker(Sticker):
|
|||||||
:class:`GuildSticker`
|
:class:`GuildSticker`
|
||||||
The newly modified sticker.
|
The newly modified sticker.
|
||||||
"""
|
"""
|
||||||
payload: EditGuildSticker = {}
|
payload = {}
|
||||||
|
|
||||||
if name is not MISSING:
|
if name is not MISSING:
|
||||||
payload['name'] = name
|
payload['name'] = name
|
||||||
|
@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict
|
from typing import List, Literal, Optional, TypedDict
|
||||||
|
from typing_extensions import NotRequired
|
||||||
from .user import User
|
from .user import User
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
|
|
||||||
@ -69,13 +70,10 @@ class ActivitySecrets(TypedDict, total=False):
|
|||||||
match: str
|
match: str
|
||||||
|
|
||||||
|
|
||||||
class _ActivityEmojiOptional(TypedDict, total=False):
|
class ActivityEmoji(TypedDict):
|
||||||
id: Snowflake
|
|
||||||
animated: bool
|
|
||||||
|
|
||||||
|
|
||||||
class ActivityEmoji(_ActivityEmojiOptional):
|
|
||||||
name: str
|
name: str
|
||||||
|
id: NotRequired[Snowflake]
|
||||||
|
animated: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
class ActivityButton(TypedDict):
|
class ActivityButton(TypedDict):
|
||||||
@ -83,16 +81,13 @@ class ActivityButton(TypedDict):
|
|||||||
url: str
|
url: str
|
||||||
|
|
||||||
|
|
||||||
class _SendableActivityOptional(TypedDict, total=False):
|
|
||||||
url: Optional[str]
|
|
||||||
|
|
||||||
|
|
||||||
ActivityType = Literal[0, 1, 2, 4, 5]
|
ActivityType = Literal[0, 1, 2, 4, 5]
|
||||||
|
|
||||||
|
|
||||||
class SendableActivity(_SendableActivityOptional):
|
class SendableActivity(TypedDict):
|
||||||
name: str
|
name: str
|
||||||
type: ActivityType
|
type: ActivityType
|
||||||
|
url: NotRequired[Optional[str]]
|
||||||
|
|
||||||
|
|
||||||
class _BaseActivity(SendableActivity):
|
class _BaseActivity(SendableActivity):
|
||||||
|
@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TypedDict, List, Optional
|
from typing import TypedDict, List, Optional
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .user import User
|
from .user import User
|
||||||
from .team import Team
|
from .team import Team
|
||||||
@ -40,25 +41,22 @@ class BaseAppInfo(TypedDict):
|
|||||||
description: str
|
description: str
|
||||||
|
|
||||||
|
|
||||||
class _AppInfoOptional(TypedDict, total=False):
|
class AppInfo(BaseAppInfo):
|
||||||
team: Team
|
|
||||||
guild_id: Snowflake
|
|
||||||
primary_sku_id: Snowflake
|
|
||||||
slug: str
|
|
||||||
terms_of_service_url: str
|
|
||||||
privacy_policy_url: str
|
|
||||||
hook: bool
|
|
||||||
max_participants: int
|
|
||||||
|
|
||||||
|
|
||||||
class AppInfo(BaseAppInfo, _AppInfoOptional):
|
|
||||||
rpc_origins: List[str]
|
rpc_origins: List[str]
|
||||||
owner: User
|
owner: User
|
||||||
bot_public: bool
|
bot_public: bool
|
||||||
bot_require_code_grant: bool
|
bot_require_code_grant: bool
|
||||||
|
team: NotRequired[Team]
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
primary_sku_id: NotRequired[Snowflake]
|
||||||
|
slug: NotRequired[str]
|
||||||
|
terms_of_service_url: NotRequired[str]
|
||||||
|
privacy_policy_url: NotRequired[str]
|
||||||
|
hook: NotRequired[bool]
|
||||||
|
max_participants: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
class _PartialAppInfoOptional(TypedDict, total=False):
|
class PartialAppInfo(BaseAppInfo, total=False):
|
||||||
rpc_origins: List[str]
|
rpc_origins: List[str]
|
||||||
cover_image: str
|
cover_image: str
|
||||||
hook: bool
|
hook: bool
|
||||||
@ -68,10 +66,6 @@ class _PartialAppInfoOptional(TypedDict, total=False):
|
|||||||
flags: int
|
flags: int
|
||||||
|
|
||||||
|
|
||||||
class PartialAppInfo(_PartialAppInfoOptional, BaseAppInfo):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class GatewayAppInfo(TypedDict):
|
class GatewayAppInfo(TypedDict):
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
flags: int
|
flags: int
|
||||||
|
@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict, Union
|
from typing import List, Literal, Optional, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .webhook import Webhook
|
from .webhook import Webhook
|
||||||
from .guild import MFALevel, VerificationLevel, ExplicitContentFilterLevel, DefaultMessageNotificationLevel
|
from .guild import MFALevel, VerificationLevel, ExplicitContentFilterLevel, DefaultMessageNotificationLevel
|
||||||
@ -273,17 +274,14 @@ class AuditEntryInfo(TypedDict):
|
|||||||
role_name: str
|
role_name: str
|
||||||
|
|
||||||
|
|
||||||
class _AuditLogEntryOptional(TypedDict, total=False):
|
class AuditLogEntry(TypedDict):
|
||||||
changes: List[AuditLogChange]
|
|
||||||
options: AuditEntryInfo
|
|
||||||
reason: str
|
|
||||||
|
|
||||||
|
|
||||||
class AuditLogEntry(_AuditLogEntryOptional):
|
|
||||||
target_id: Optional[str]
|
target_id: Optional[str]
|
||||||
user_id: Optional[Snowflake]
|
user_id: Optional[Snowflake]
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
action_type: AuditLogEvent
|
action_type: AuditLogEvent
|
||||||
|
changes: NotRequired[List[AuditLogChange]]
|
||||||
|
options: NotRequired[AuditEntryInfo]
|
||||||
|
reason: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class AuditLog(TypedDict):
|
class AuditLog(TypedDict):
|
||||||
|
@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict, Union
|
from typing import List, Literal, Optional, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .user import PartialUser
|
from .user import PartialUser
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
from .threads import ThreadMetadata, ThreadMember, ThreadArchiveDuration, ThreadType
|
from .threads import ThreadMetadata, ThreadMember, ThreadArchiveDuration, ThreadType
|
||||||
@ -59,7 +61,7 @@ class PartialChannel(_BaseChannel):
|
|||||||
type: ChannelType
|
type: ChannelType
|
||||||
|
|
||||||
|
|
||||||
class _TextChannelOptional(TypedDict, total=False):
|
class _BaseTextChannel(_BaseGuildChannel, total=False):
|
||||||
topic: str
|
topic: str
|
||||||
last_message_id: Optional[Snowflake]
|
last_message_id: Optional[Snowflake]
|
||||||
last_pin_timestamp: str
|
last_pin_timestamp: str
|
||||||
@ -67,52 +69,38 @@ class _TextChannelOptional(TypedDict, total=False):
|
|||||||
default_auto_archive_duration: ThreadArchiveDuration
|
default_auto_archive_duration: ThreadArchiveDuration
|
||||||
|
|
||||||
|
|
||||||
class TextChannel(_BaseGuildChannel, _TextChannelOptional):
|
class TextChannel(_BaseTextChannel):
|
||||||
type: Literal[0]
|
type: Literal[0]
|
||||||
|
|
||||||
|
|
||||||
class NewsChannel(_BaseGuildChannel, _TextChannelOptional):
|
class NewsChannel(_BaseTextChannel):
|
||||||
type: Literal[5]
|
type: Literal[5]
|
||||||
|
|
||||||
|
|
||||||
VideoQualityMode = Literal[1, 2]
|
VideoQualityMode = Literal[1, 2]
|
||||||
|
|
||||||
|
|
||||||
class _VoiceChannelOptional(TypedDict, total=False):
|
class VoiceChannel(_BaseTextChannel):
|
||||||
rtc_region: Optional[str]
|
|
||||||
video_quality_mode: VideoQualityMode
|
|
||||||
|
|
||||||
|
|
||||||
class VoiceChannel(_BaseGuildChannel, _VoiceChannelOptional):
|
|
||||||
type: Literal[2]
|
type: Literal[2]
|
||||||
bitrate: int
|
bitrate: int
|
||||||
user_limit: int
|
user_limit: int
|
||||||
|
rtc_region: NotRequired[Optional[str]]
|
||||||
|
video_quality_mode: NotRequired[VideoQualityMode]
|
||||||
|
|
||||||
|
|
||||||
class CategoryChannel(_BaseGuildChannel):
|
class CategoryChannel(_BaseGuildChannel):
|
||||||
type: Literal[4]
|
type: Literal[4]
|
||||||
|
|
||||||
|
|
||||||
class _StageChannelOptional(TypedDict, total=False):
|
class StageChannel(_BaseGuildChannel):
|
||||||
rtc_region: Optional[str]
|
|
||||||
topic: str
|
|
||||||
|
|
||||||
|
|
||||||
class StageChannel(_BaseGuildChannel, _StageChannelOptional):
|
|
||||||
type: Literal[13]
|
type: Literal[13]
|
||||||
bitrate: int
|
bitrate: int
|
||||||
user_limit: int
|
user_limit: int
|
||||||
|
rtc_region: NotRequired[Optional[str]]
|
||||||
|
topic: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class _ThreadChannelOptional(TypedDict, total=False):
|
class ThreadChannel(_BaseChannel):
|
||||||
member: ThreadMember
|
|
||||||
owner_id: Snowflake
|
|
||||||
rate_limit_per_user: int
|
|
||||||
last_message_id: Optional[Snowflake]
|
|
||||||
last_pin_timestamp: str
|
|
||||||
|
|
||||||
|
|
||||||
class ThreadChannel(_BaseChannel, _ThreadChannelOptional):
|
|
||||||
type: Literal[10, 11, 12]
|
type: Literal[10, 11, 12]
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
parent_id: Snowflake
|
parent_id: Snowflake
|
||||||
@ -123,6 +111,11 @@ class ThreadChannel(_BaseChannel, _ThreadChannelOptional):
|
|||||||
message_count: int
|
message_count: int
|
||||||
member_count: int
|
member_count: int
|
||||||
thread_metadata: ThreadMetadata
|
thread_metadata: ThreadMetadata
|
||||||
|
member: NotRequired[ThreadMember]
|
||||||
|
owner_id: NotRequired[Snowflake]
|
||||||
|
rate_limit_per_user: NotRequired[int]
|
||||||
|
last_message_id: NotRequired[Optional[Snowflake]]
|
||||||
|
last_pin_timestamp: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
GuildChannel = Union[TextChannel, NewsChannel, VoiceChannel, CategoryChannel, StageChannel, ThreadChannel]
|
GuildChannel = Union[TextChannel, NewsChannel, VoiceChannel, CategoryChannel, StageChannel, ThreadChannel]
|
||||||
|
@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Literal, TypedDict, Union
|
from typing import List, Literal, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired, Required
|
||||||
|
|
||||||
from .channel import ChannelType
|
from .channel import ChannelType
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
@ -57,13 +58,10 @@ class _StringApplicationCommandOptionChoice(TypedDict):
|
|||||||
value: str
|
value: str
|
||||||
|
|
||||||
|
|
||||||
class _StringApplicationCommandOptionOptional(_BaseValueApplicationCommandOption, total=False):
|
class _StringApplicationCommandOption(_BaseApplicationCommandOption):
|
||||||
choices: List[_StringApplicationCommandOptionChoice]
|
|
||||||
autocomplete: bool
|
|
||||||
|
|
||||||
|
|
||||||
class _StringApplicationCommandOption(_StringApplicationCommandOptionOptional):
|
|
||||||
type: Literal[3]
|
type: Literal[3]
|
||||||
|
choices: NotRequired[List[_StringApplicationCommandOptionChoice]]
|
||||||
|
autocomplete: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
class _IntegerApplicationCommandOptionChoice(TypedDict):
|
class _IntegerApplicationCommandOptionChoice(TypedDict):
|
||||||
@ -71,27 +69,21 @@ class _IntegerApplicationCommandOptionChoice(TypedDict):
|
|||||||
value: int
|
value: int
|
||||||
|
|
||||||
|
|
||||||
class _IntegerApplicationCommandOptionOptional(_BaseValueApplicationCommandOption, total=False):
|
class _IntegerApplicationCommandOption(_BaseApplicationCommandOption, total=False):
|
||||||
|
type: Required[Literal[4]]
|
||||||
min_value: int
|
min_value: int
|
||||||
max_value: int
|
max_value: int
|
||||||
choices: List[_IntegerApplicationCommandOptionChoice]
|
choices: List[_IntegerApplicationCommandOptionChoice]
|
||||||
autocomplete: bool
|
autocomplete: bool
|
||||||
|
|
||||||
|
|
||||||
class _IntegerApplicationCommandOption(_IntegerApplicationCommandOptionOptional):
|
|
||||||
type: Literal[4]
|
|
||||||
|
|
||||||
|
|
||||||
class _BooleanApplicationCommandOption(_BaseValueApplicationCommandOption):
|
class _BooleanApplicationCommandOption(_BaseValueApplicationCommandOption):
|
||||||
type: Literal[5]
|
type: Literal[5]
|
||||||
|
|
||||||
|
|
||||||
class _ChannelApplicationCommandOptionChoiceOptional(_BaseApplicationCommandOption, total=False):
|
class _ChannelApplicationCommandOptionChoice(_BaseApplicationCommandOption):
|
||||||
channel_types: List[ChannelType]
|
|
||||||
|
|
||||||
|
|
||||||
class _ChannelApplicationCommandOptionChoice(_ChannelApplicationCommandOptionChoiceOptional):
|
|
||||||
type: Literal[7]
|
type: Literal[7]
|
||||||
|
channel_types: NotRequired[List[ChannelType]]
|
||||||
|
|
||||||
|
|
||||||
class _NonChannelSnowflakeApplicationCommandOptionChoice(_BaseValueApplicationCommandOption):
|
class _NonChannelSnowflakeApplicationCommandOptionChoice(_BaseValueApplicationCommandOption):
|
||||||
@ -109,17 +101,14 @@ class _NumberApplicationCommandOptionChoice(TypedDict):
|
|||||||
value: float
|
value: float
|
||||||
|
|
||||||
|
|
||||||
class _NumberApplicationCommandOptionOptional(_BaseValueApplicationCommandOption, total=False):
|
class _NumberApplicationCommandOption(_BaseValueApplicationCommandOption, total=False):
|
||||||
|
type: Required[Literal[10]]
|
||||||
min_value: float
|
min_value: float
|
||||||
max_value: float
|
max_value: float
|
||||||
choices: List[_NumberApplicationCommandOptionChoice]
|
choices: List[_NumberApplicationCommandOptionChoice]
|
||||||
autocomplete: bool
|
autocomplete: bool
|
||||||
|
|
||||||
|
|
||||||
class _NumberApplicationCommandOption(_NumberApplicationCommandOptionOptional):
|
|
||||||
type: Literal[10]
|
|
||||||
|
|
||||||
|
|
||||||
_ValueApplicationCommandOption = Union[
|
_ValueApplicationCommandOption = Union[
|
||||||
_StringApplicationCommandOption,
|
_StringApplicationCommandOption,
|
||||||
_IntegerApplicationCommandOption,
|
_IntegerApplicationCommandOption,
|
||||||
@ -148,7 +137,8 @@ class _BaseApplicationCommand(TypedDict):
|
|||||||
version: Snowflake
|
version: Snowflake
|
||||||
|
|
||||||
|
|
||||||
class _ChatInputApplicationCommandOptional(_BaseApplicationCommand, total=False):
|
class _ChatInputApplicationCommand(_BaseApplicationCommand, total=False):
|
||||||
|
description: Required[str]
|
||||||
type: Literal[1]
|
type: Literal[1]
|
||||||
options: Union[
|
options: Union[
|
||||||
List[_ValueApplicationCommandOption],
|
List[_ValueApplicationCommandOption],
|
||||||
@ -156,10 +146,6 @@ class _ChatInputApplicationCommandOptional(_BaseApplicationCommand, total=False)
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class _ChatInputApplicationCommand(_ChatInputApplicationCommandOptional):
|
|
||||||
description: str
|
|
||||||
|
|
||||||
|
|
||||||
class _BaseContextMenuApplicationCommand(_BaseApplicationCommand):
|
class _BaseContextMenuApplicationCommand(_BaseApplicationCommand):
|
||||||
description: Literal[""]
|
description: Literal[""]
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Literal, TypedDict, Union
|
from typing import List, Literal, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .emoji import PartialEmoji
|
from .emoji import PartialEmoji
|
||||||
|
|
||||||
ComponentType = Literal[1, 2, 3, 4]
|
ComponentType = Literal[1, 2, 3, 4]
|
||||||
@ -37,56 +39,44 @@ class ActionRow(TypedDict):
|
|||||||
components: List[Component]
|
components: List[Component]
|
||||||
|
|
||||||
|
|
||||||
class _ButtonComponentOptional(TypedDict, total=False):
|
class ButtonComponent(TypedDict):
|
||||||
custom_id: str
|
|
||||||
url: str
|
|
||||||
disabled: bool
|
|
||||||
emoji: PartialEmoji
|
|
||||||
label: str
|
|
||||||
|
|
||||||
|
|
||||||
class ButtonComponent(_ButtonComponentOptional):
|
|
||||||
type: Literal[2]
|
type: Literal[2]
|
||||||
style: ButtonStyle
|
style: ButtonStyle
|
||||||
|
custom_id: NotRequired[str]
|
||||||
|
url: NotRequired[str]
|
||||||
|
disabled: NotRequired[bool]
|
||||||
|
emoji: NotRequired[PartialEmoji]
|
||||||
|
label: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class _SelectMenuOptional(TypedDict, total=False):
|
class SelectOption(TypedDict):
|
||||||
placeholder: str
|
|
||||||
min_values: int
|
|
||||||
max_values: int
|
|
||||||
disabled: bool
|
|
||||||
|
|
||||||
|
|
||||||
class _SelectOptionsOptional(TypedDict, total=False):
|
|
||||||
description: str
|
|
||||||
emoji: PartialEmoji
|
|
||||||
|
|
||||||
|
|
||||||
class SelectOption(_SelectOptionsOptional):
|
|
||||||
label: str
|
label: str
|
||||||
value: str
|
value: str
|
||||||
default: bool
|
default: bool
|
||||||
|
description: NotRequired[str]
|
||||||
|
emoji: NotRequired[PartialEmoji]
|
||||||
|
|
||||||
|
|
||||||
class SelectMenu(_SelectMenuOptional):
|
class SelectMenu(TypedDict):
|
||||||
type: Literal[3]
|
type: Literal[3]
|
||||||
custom_id: str
|
custom_id: str
|
||||||
options: List[SelectOption]
|
options: List[SelectOption]
|
||||||
|
placeholder: NotRequired[str]
|
||||||
|
min_values: NotRequired[int]
|
||||||
|
max_values: NotRequired[int]
|
||||||
|
disabled: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
class _TextInputOptional(TypedDict, total=False):
|
class TextInput(TypedDict):
|
||||||
placeholder: str
|
|
||||||
value: str
|
|
||||||
required: bool
|
|
||||||
min_length: int
|
|
||||||
max_length: int
|
|
||||||
|
|
||||||
|
|
||||||
class TextInput(_TextInputOptional):
|
|
||||||
type: Literal[4]
|
type: Literal[4]
|
||||||
custom_id: str
|
custom_id: str
|
||||||
style: TextStyle
|
style: TextStyle
|
||||||
label: str
|
label: str
|
||||||
|
placeholder: NotRequired[str]
|
||||||
|
value: NotRequired[str]
|
||||||
|
required: NotRequired[bool]
|
||||||
|
min_length: NotRequired[int]
|
||||||
|
max_length: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
Component = Union[ActionRow, ButtonComponent, SelectMenu, TextInput]
|
Component = Union[ActionRow, ButtonComponent, SelectMenu, TextInput]
|
||||||
|
@ -23,36 +23,28 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import List, Literal, TypedDict
|
from typing import List, Literal, TypedDict
|
||||||
|
from typing_extensions import NotRequired, Required
|
||||||
|
|
||||||
|
|
||||||
class _EmbedFooterOptional(TypedDict, total=False):
|
class EmbedFooter(TypedDict):
|
||||||
icon_url: str
|
|
||||||
proxy_icon_url: str
|
|
||||||
|
|
||||||
|
|
||||||
class EmbedFooter(_EmbedFooterOptional):
|
|
||||||
text: str
|
text: str
|
||||||
|
icon_url: NotRequired[str]
|
||||||
|
proxy_icon_url: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class _EmbedFieldOptional(TypedDict, total=False):
|
class EmbedField(TypedDict):
|
||||||
inline: bool
|
|
||||||
|
|
||||||
|
|
||||||
class EmbedField(_EmbedFieldOptional):
|
|
||||||
name: str
|
name: str
|
||||||
value: str
|
value: str
|
||||||
|
inline: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
class _EmbedThumbnailOptional(TypedDict, total=False):
|
class EmbedThumbnail(TypedDict, total=False):
|
||||||
|
url: Required[str]
|
||||||
proxy_url: str
|
proxy_url: str
|
||||||
height: int
|
height: int
|
||||||
width: int
|
width: int
|
||||||
|
|
||||||
|
|
||||||
class EmbedThumbnail(_EmbedThumbnailOptional):
|
|
||||||
url: str
|
|
||||||
|
|
||||||
|
|
||||||
class EmbedVideo(TypedDict, total=False):
|
class EmbedVideo(TypedDict, total=False):
|
||||||
url: str
|
url: str
|
||||||
proxy_url: str
|
proxy_url: str
|
||||||
@ -60,31 +52,25 @@ class EmbedVideo(TypedDict, total=False):
|
|||||||
width: int
|
width: int
|
||||||
|
|
||||||
|
|
||||||
class _EmbedImageOptional(TypedDict, total=False):
|
class EmbedImage(TypedDict, total=False):
|
||||||
|
url: Required[str]
|
||||||
proxy_url: str
|
proxy_url: str
|
||||||
height: int
|
height: int
|
||||||
width: int
|
width: int
|
||||||
|
|
||||||
|
|
||||||
class EmbedImage(_EmbedImageOptional):
|
|
||||||
url: str
|
|
||||||
|
|
||||||
|
|
||||||
class EmbedProvider(TypedDict, total=False):
|
class EmbedProvider(TypedDict, total=False):
|
||||||
name: str
|
name: str
|
||||||
url: str
|
url: str
|
||||||
|
|
||||||
|
|
||||||
class _EmbedAuthorOptional(TypedDict, total=False):
|
class EmbedAuthor(TypedDict, total=False):
|
||||||
|
name: Required[str]
|
||||||
url: str
|
url: str
|
||||||
icon_url: str
|
icon_url: str
|
||||||
proxy_icon_url: str
|
proxy_icon_url: str
|
||||||
|
|
||||||
|
|
||||||
class EmbedAuthor(_EmbedAuthorOptional):
|
|
||||||
name: str
|
|
||||||
|
|
||||||
|
|
||||||
EmbedType = Literal['rich', 'image', 'video', 'gifv', 'article', 'link']
|
EmbedType = Literal['rich', 'image', 'video', 'gifv', 'article', 'link']
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict
|
from typing import List, Literal, Optional, TypedDict
|
||||||
|
from typing_extensions import NotRequired, Required
|
||||||
|
|
||||||
from .activity import PartialPresenceUpdate
|
from .activity import PartialPresenceUpdate
|
||||||
from .voice import GuildVoiceState
|
from .voice import GuildVoiceState
|
||||||
@ -79,68 +79,50 @@ ResumedEvent = Literal[None]
|
|||||||
MessageCreateEvent = Message
|
MessageCreateEvent = Message
|
||||||
|
|
||||||
|
|
||||||
class _MessageDeleteEventOptional(TypedDict, total=False):
|
class MessageDeleteEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class MessageDeleteEvent(_MessageDeleteEventOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class _MessageDeleteBulkEventOptional(TypedDict, total=False):
|
class MessageDeleteBulkEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class MessageDeleteBulkEvent(_MessageDeleteBulkEventOptional):
|
|
||||||
ids: List[Snowflake]
|
ids: List[Snowflake]
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class MessageUpdateEvent(Message):
|
class MessageUpdateEvent(Message):
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
|
|
||||||
|
|
||||||
class _MessageReactionAddEventOptional(TypedDict, total=False):
|
class MessageReactionAddEvent(TypedDict):
|
||||||
member: MemberWithUser
|
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class MessageReactionAddEvent(_MessageReactionAddEventOptional):
|
|
||||||
user_id: Snowflake
|
user_id: Snowflake
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
message_id: Snowflake
|
message_id: Snowflake
|
||||||
emoji: PartialEmoji
|
emoji: PartialEmoji
|
||||||
|
member: NotRequired[MemberWithUser]
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class _MessageReactionRemoveEventOptional(TypedDict, total=False):
|
class MessageReactionRemoveEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class MessageReactionRemoveEvent(_MessageReactionRemoveEventOptional):
|
|
||||||
user_id: Snowflake
|
user_id: Snowflake
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
message_id: Snowflake
|
message_id: Snowflake
|
||||||
emoji: PartialEmoji
|
emoji: PartialEmoji
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class _MessageReactionRemoveAllEventOptional(TypedDict, total=False):
|
class MessageReactionRemoveAllEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class MessageReactionRemoveAllEvent(_MessageReactionRemoveAllEventOptional):
|
|
||||||
message_id: Snowflake
|
message_id: Snowflake
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class _MessageReactionRemoveEmojiEventOptional(TypedDict, total=False):
|
class MessageReactionRemoveEmojiEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class MessageReactionRemoveEmojiEvent(_MessageReactionRemoveEmojiEventOptional):
|
|
||||||
emoji: PartialEmoji
|
emoji: PartialEmoji
|
||||||
message_id: Snowflake
|
message_id: Snowflake
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
InteractionCreateEvent = Interaction
|
InteractionCreateEvent = Interaction
|
||||||
@ -152,15 +134,7 @@ PresenceUpdateEvent = PartialPresenceUpdate
|
|||||||
UserUpdateEvent = User
|
UserUpdateEvent = User
|
||||||
|
|
||||||
|
|
||||||
class _InviteCreateEventOptional(TypedDict, total=False):
|
class InviteCreateEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
inviter: User
|
|
||||||
target_type: InviteTargetType
|
|
||||||
target_user: User
|
|
||||||
target_application: PartialAppInfo
|
|
||||||
|
|
||||||
|
|
||||||
class InviteCreateEvent(_InviteCreateEventOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
code: str
|
code: str
|
||||||
created_at: str
|
created_at: str
|
||||||
@ -168,15 +142,17 @@ class InviteCreateEvent(_InviteCreateEventOptional):
|
|||||||
max_uses: int
|
max_uses: int
|
||||||
temporary: bool
|
temporary: bool
|
||||||
uses: Literal[0]
|
uses: Literal[0]
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
inviter: NotRequired[User]
|
||||||
|
target_type: NotRequired[InviteTargetType]
|
||||||
|
target_user: NotRequired[User]
|
||||||
|
target_application: NotRequired[PartialAppInfo]
|
||||||
|
|
||||||
|
|
||||||
class _InviteDeleteEventOptional(TypedDict, total=False):
|
class InviteDeleteEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class InviteDeleteEvent(_InviteDeleteEventOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
code: str
|
code: str
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class _ChannelEvent(TypedDict):
|
class _ChannelEvent(TypedDict):
|
||||||
@ -187,24 +163,17 @@ class _ChannelEvent(TypedDict):
|
|||||||
ChannelCreateEvent = ChannelUpdateEvent = ChannelDeleteEvent = _ChannelEvent
|
ChannelCreateEvent = ChannelUpdateEvent = ChannelDeleteEvent = _ChannelEvent
|
||||||
|
|
||||||
|
|
||||||
class _ChannelPinsUpdateEventOptional(TypedDict, total=False):
|
class ChannelPinsUpdateEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
last_pin_timestamp: Optional[str]
|
|
||||||
|
|
||||||
|
|
||||||
class ChannelPinsUpdateEvent(_ChannelPinsUpdateEventOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
last_pin_timestamp: NotRequired[Optional[str]]
|
||||||
|
|
||||||
|
|
||||||
class _ThreadCreateEventOptional(TypedDict, total=False):
|
class ThreadCreateEvent(Thread, total=False):
|
||||||
newly_created: bool
|
newly_created: bool
|
||||||
members: List[ThreadMember]
|
members: List[ThreadMember]
|
||||||
|
|
||||||
|
|
||||||
class ThreadCreateEvent(Thread, _ThreadCreateEventOptional):
|
|
||||||
...
|
|
||||||
|
|
||||||
|
|
||||||
ThreadUpdateEvent = Thread
|
ThreadUpdateEvent = Thread
|
||||||
|
|
||||||
|
|
||||||
@ -215,29 +184,23 @@ class ThreadDeleteEvent(TypedDict):
|
|||||||
type: ChannelType
|
type: ChannelType
|
||||||
|
|
||||||
|
|
||||||
class _ThreadListSyncEventOptional(TypedDict, total=False):
|
class ThreadListSyncEvent(TypedDict):
|
||||||
channel_ids: List[Snowflake]
|
|
||||||
|
|
||||||
|
|
||||||
class ThreadListSyncEvent(_ThreadListSyncEventOptional):
|
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
threads: List[Thread]
|
threads: List[Thread]
|
||||||
members: List[ThreadMember]
|
members: List[ThreadMember]
|
||||||
|
channel_ids: NotRequired[List[Snowflake]]
|
||||||
|
|
||||||
|
|
||||||
class ThreadMemberUpdate(ThreadMember):
|
class ThreadMemberUpdate(ThreadMember):
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
|
|
||||||
|
|
||||||
class _ThreadMembersUpdateOptional(TypedDict, total=False):
|
class ThreadMembersUpdate(TypedDict):
|
||||||
added_members: List[ThreadMember]
|
|
||||||
removed_member_ids: List[Snowflake]
|
|
||||||
|
|
||||||
|
|
||||||
class ThreadMembersUpdate(_ThreadMembersUpdateOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
member_count: int
|
member_count: int
|
||||||
|
added_members: NotRequired[List[ThreadMember]]
|
||||||
|
removed_member_ids: NotRequired[List[Snowflake]]
|
||||||
|
|
||||||
|
|
||||||
class GuildMemberAddEvent(MemberWithUser):
|
class GuildMemberAddEvent(MemberWithUser):
|
||||||
@ -249,21 +212,18 @@ class GuildMemberRemoveEvent(TypedDict):
|
|||||||
user: User
|
user: User
|
||||||
|
|
||||||
|
|
||||||
class _GuildMemberUpdateEventOptional(TypedDict, total=False):
|
class GuildMemberUpdateEvent(TypedDict):
|
||||||
nick: str
|
|
||||||
premium_since: Optional[str]
|
|
||||||
deaf: bool
|
|
||||||
mute: bool
|
|
||||||
pending: bool
|
|
||||||
communication_disabled_until: str
|
|
||||||
|
|
||||||
|
|
||||||
class GuildMemberUpdateEvent(_GuildMemberUpdateEventOptional):
|
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
roles: List[Snowflake]
|
roles: List[Snowflake]
|
||||||
user: User
|
user: User
|
||||||
avatar: Optional[str]
|
avatar: Optional[str]
|
||||||
joined_at: Optional[str]
|
joined_at: Optional[str]
|
||||||
|
nick: NotRequired[str]
|
||||||
|
premium_since: NotRequired[Optional[str]]
|
||||||
|
deaf: NotRequired[bool]
|
||||||
|
mute: NotRequired[bool]
|
||||||
|
pending: NotRequired[bool]
|
||||||
|
communication_disabled_until: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class GuildEmojisUpdateEvent(TypedDict):
|
class GuildEmojisUpdateEvent(TypedDict):
|
||||||
@ -301,24 +261,22 @@ class GuildRoleDeleteEvent(TypedDict):
|
|||||||
GuildRoleCreateEvent = GuildRoleUpdateEvent = _GuildRoleEvent
|
GuildRoleCreateEvent = GuildRoleUpdateEvent = _GuildRoleEvent
|
||||||
|
|
||||||
|
|
||||||
class _GuildMembersChunkEventOptional(TypedDict, total=False):
|
class GuildMembersChunkEvent(TypedDict):
|
||||||
not_found: List[Snowflake]
|
|
||||||
presences: List[PresenceUpdateEvent]
|
|
||||||
nonce: str
|
|
||||||
|
|
||||||
|
|
||||||
class GuildMembersChunkEvent(_GuildMembersChunkEventOptional):
|
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
members: List[MemberWithUser]
|
members: List[MemberWithUser]
|
||||||
chunk_index: int
|
chunk_index: int
|
||||||
chunk_count: int
|
chunk_count: int
|
||||||
|
not_found: NotRequired[List[Snowflake]]
|
||||||
|
presences: NotRequired[List[PresenceUpdateEvent]]
|
||||||
|
nonce: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class GuildIntegrationsUpdateEvent(TypedDict):
|
class GuildIntegrationsUpdateEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
|
|
||||||
|
|
||||||
class _IntegrationEventOptional(BaseIntegration, total=False):
|
class _IntegrationEvent(BaseIntegration, total=False):
|
||||||
|
guild_id: Required[Snowflake]
|
||||||
role_id: Optional[Snowflake]
|
role_id: Optional[Snowflake]
|
||||||
enable_emoticons: bool
|
enable_emoticons: bool
|
||||||
subscriber_count: int
|
subscriber_count: int
|
||||||
@ -326,20 +284,13 @@ class _IntegrationEventOptional(BaseIntegration, total=False):
|
|||||||
application: IntegrationApplication
|
application: IntegrationApplication
|
||||||
|
|
||||||
|
|
||||||
class _IntegrationEvent(_IntegrationEventOptional):
|
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
IntegrationCreateEvent = IntegrationUpdateEvent = _IntegrationEvent
|
IntegrationCreateEvent = IntegrationUpdateEvent = _IntegrationEvent
|
||||||
|
|
||||||
|
|
||||||
class _IntegrationDeleteEventOptional(TypedDict, total=False):
|
class IntegrationDeleteEvent(TypedDict):
|
||||||
application_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class IntegrationDeleteEvent(_IntegrationDeleteEventOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
|
application_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class WebhooksUpdateEvent(TypedDict):
|
class WebhooksUpdateEvent(TypedDict):
|
||||||
@ -369,12 +320,9 @@ class VoiceServerUpdateEvent(TypedDict):
|
|||||||
endpoint: Optional[str]
|
endpoint: Optional[str]
|
||||||
|
|
||||||
|
|
||||||
class _TypingStartEventOptional(TypedDict, total=False):
|
class TypingStartEvent(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
member: MemberWithUser
|
|
||||||
|
|
||||||
|
|
||||||
class TypingStartEvent(_TypingStartEventOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
user_id: Snowflake
|
user_id: Snowflake
|
||||||
timestamp: int
|
timestamp: int
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
member: NotRequired[MemberWithUser]
|
||||||
|
@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict
|
from typing import List, Literal, Optional, TypedDict
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .scheduled_event import GuildScheduledEvent
|
from .scheduled_event import GuildScheduledEvent
|
||||||
from .sticker import GuildSticker
|
from .sticker import GuildSticker
|
||||||
@ -43,32 +44,9 @@ class Ban(TypedDict):
|
|||||||
user: User
|
user: User
|
||||||
|
|
||||||
|
|
||||||
class _UnavailableGuildOptional(TypedDict, total=False):
|
class UnavailableGuild(TypedDict):
|
||||||
unavailable: bool
|
|
||||||
|
|
||||||
|
|
||||||
class UnavailableGuild(_UnavailableGuildOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
|
unavailable: NotRequired[bool]
|
||||||
|
|
||||||
class _GuildOptional(TypedDict, total=False):
|
|
||||||
icon_hash: Optional[str]
|
|
||||||
owner: bool
|
|
||||||
permissions: str
|
|
||||||
widget_enabled: bool
|
|
||||||
widget_channel_id: Optional[Snowflake]
|
|
||||||
joined_at: Optional[str]
|
|
||||||
large: bool
|
|
||||||
member_count: int
|
|
||||||
voice_states: List[GuildVoiceState]
|
|
||||||
members: List[Member]
|
|
||||||
channels: List[GuildChannel]
|
|
||||||
presences: List[PartialPresenceUpdate]
|
|
||||||
threads: List[Thread]
|
|
||||||
max_presences: Optional[int]
|
|
||||||
max_members: int
|
|
||||||
premium_subscription_count: int
|
|
||||||
max_video_channel_users: int
|
|
||||||
|
|
||||||
|
|
||||||
DefaultMessageNotificationLevel = Literal[0, 1]
|
DefaultMessageNotificationLevel = Literal[0, 1]
|
||||||
@ -124,7 +102,7 @@ class GuildPreview(_BaseGuildPreview, _GuildPreviewUnique):
|
|||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
class Guild(_BaseGuildPreview, _GuildOptional):
|
class Guild(_BaseGuildPreview):
|
||||||
owner_id: Snowflake
|
owner_id: Snowflake
|
||||||
region: str
|
region: str
|
||||||
afk_channel_id: Optional[Snowflake]
|
afk_channel_id: Optional[Snowflake]
|
||||||
@ -147,6 +125,23 @@ class Guild(_BaseGuildPreview, _GuildOptional):
|
|||||||
stickers: List[GuildSticker]
|
stickers: List[GuildSticker]
|
||||||
stage_instances: List[StageInstance]
|
stage_instances: List[StageInstance]
|
||||||
guild_scheduled_events: List[GuildScheduledEvent]
|
guild_scheduled_events: List[GuildScheduledEvent]
|
||||||
|
icon_hash: NotRequired[Optional[str]]
|
||||||
|
owner: NotRequired[bool]
|
||||||
|
permissions: NotRequired[str]
|
||||||
|
widget_enabled: NotRequired[bool]
|
||||||
|
widget_channel_id: NotRequired[Optional[Snowflake]]
|
||||||
|
joined_at: NotRequired[Optional[str]]
|
||||||
|
large: NotRequired[bool]
|
||||||
|
member_count: NotRequired[int]
|
||||||
|
voice_states: NotRequired[List[GuildVoiceState]]
|
||||||
|
members: NotRequired[List[Member]]
|
||||||
|
channels: NotRequired[List[GuildChannel]]
|
||||||
|
presences: NotRequired[List[PartialPresenceUpdate]]
|
||||||
|
threads: NotRequired[List[Thread]]
|
||||||
|
max_presences: NotRequired[Optional[int]]
|
||||||
|
max_members: NotRequired[int]
|
||||||
|
premium_subscription_count: NotRequired[int]
|
||||||
|
max_video_channel_users: NotRequired[int]
|
||||||
|
|
||||||
|
|
||||||
class InviteGuild(Guild, total=False):
|
class InviteGuild(Guild, total=False):
|
||||||
|
@ -25,20 +25,19 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Literal, Optional, TypedDict, Union
|
from typing import Literal, Optional, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
from .user import User
|
from .user import User
|
||||||
|
|
||||||
|
|
||||||
class _IntegrationApplicationOptional(TypedDict, total=False):
|
class IntegrationApplication(TypedDict):
|
||||||
bot: User
|
|
||||||
|
|
||||||
|
|
||||||
class IntegrationApplication(_IntegrationApplicationOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
name: str
|
name: str
|
||||||
icon: Optional[str]
|
icon: Optional[str]
|
||||||
description: str
|
description: str
|
||||||
summary: str
|
summary: str
|
||||||
|
bot: NotRequired[User]
|
||||||
|
|
||||||
|
|
||||||
class IntegrationAccount(TypedDict):
|
class IntegrationAccount(TypedDict):
|
||||||
|
@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, Dict, List, Literal, TypedDict, Union
|
from typing import TYPE_CHECKING, Dict, List, Literal, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .channel import ChannelTypeWithoutThread, ThreadMetadata
|
from .channel import ChannelTypeWithoutThread, ThreadMetadata
|
||||||
from .threads import ThreadType
|
from .threads import ThreadType
|
||||||
@ -120,14 +120,11 @@ ApplicationCommandInteractionDataOption = Union[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class _BaseApplicationCommandInteractionDataOptional(TypedDict, total=False):
|
class _BaseApplicationCommandInteractionData(TypedDict):
|
||||||
resolved: ResolvedData
|
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class _BaseApplicationCommandInteractionData(_BaseApplicationCommandInteractionDataOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
name: str
|
name: str
|
||||||
|
resolved: NotRequired[ResolvedData]
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class ChatInputApplicationCommandInteractionData(_BaseApplicationCommandInteractionData, total=False):
|
class ChatInputApplicationCommandInteractionData(_BaseApplicationCommandInteractionData, total=False):
|
||||||
@ -199,18 +196,15 @@ InteractionData = Union[
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class _BaseInteractionOptional(TypedDict, total=False):
|
class _BaseInteraction(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
channel_id: Snowflake
|
|
||||||
locale: str
|
|
||||||
guild_locale: str
|
|
||||||
|
|
||||||
|
|
||||||
class _BaseInteraction(_BaseInteractionOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
application_id: Snowflake
|
application_id: Snowflake
|
||||||
token: str
|
token: str
|
||||||
version: Literal[1]
|
version: Literal[1]
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
channel_id: NotRequired[Snowflake]
|
||||||
|
locale: NotRequired[str]
|
||||||
|
guild_locale: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class PingInteraction(_BaseInteraction):
|
class PingInteraction(_BaseInteraction):
|
||||||
@ -235,12 +229,9 @@ class ModalSubmitInteraction(_BaseInteraction):
|
|||||||
Interaction = Union[PingInteraction, ApplicationCommandInteraction, MessageComponentInteraction, ModalSubmitInteraction]
|
Interaction = Union[PingInteraction, ApplicationCommandInteraction, MessageComponentInteraction, ModalSubmitInteraction]
|
||||||
|
|
||||||
|
|
||||||
class _MessageInteractionOptional(TypedDict, total=False):
|
class MessageInteraction(TypedDict):
|
||||||
member: Member
|
|
||||||
|
|
||||||
|
|
||||||
class MessageInteraction(_MessageInteractionOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
type: InteractionType
|
type: InteractionType
|
||||||
name: str
|
name: str
|
||||||
user: User
|
user: User
|
||||||
|
member: NotRequired[Member]
|
||||||
|
@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Literal, Optional, TypedDict, Union
|
from typing import Literal, Optional, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired, Required
|
||||||
|
|
||||||
from .scheduled_event import GuildScheduledEvent
|
from .scheduled_event import GuildScheduledEvent
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
@ -37,15 +37,6 @@ from .appinfo import PartialAppInfo
|
|||||||
InviteTargetType = Literal[1, 2]
|
InviteTargetType = Literal[1, 2]
|
||||||
|
|
||||||
|
|
||||||
class _InviteOptional(TypedDict, total=False):
|
|
||||||
guild: InviteGuild
|
|
||||||
inviter: PartialUser
|
|
||||||
target_user: PartialUser
|
|
||||||
target_type: InviteTargetType
|
|
||||||
target_application: PartialAppInfo
|
|
||||||
guild_scheduled_event: GuildScheduledEvent
|
|
||||||
|
|
||||||
|
|
||||||
class _InviteMetadata(TypedDict, total=False):
|
class _InviteMetadata(TypedDict, total=False):
|
||||||
uses: int
|
uses: int
|
||||||
max_uses: int
|
max_uses: int
|
||||||
@ -55,12 +46,9 @@ class _InviteMetadata(TypedDict, total=False):
|
|||||||
expires_at: Optional[str]
|
expires_at: Optional[str]
|
||||||
|
|
||||||
|
|
||||||
class _VanityInviteOptional(_InviteMetadata, total=False):
|
class VanityInvite(_InviteMetadata):
|
||||||
revoked: bool
|
|
||||||
|
|
||||||
|
|
||||||
class VanityInvite(_VanityInviteOptional):
|
|
||||||
code: Optional[str]
|
code: Optional[str]
|
||||||
|
revoked: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
class IncompleteInvite(_InviteMetadata):
|
class IncompleteInvite(_InviteMetadata):
|
||||||
@ -68,23 +56,20 @@ class IncompleteInvite(_InviteMetadata):
|
|||||||
channel: PartialChannel
|
channel: PartialChannel
|
||||||
|
|
||||||
|
|
||||||
class Invite(IncompleteInvite, _InviteOptional):
|
class Invite(IncompleteInvite, total=False):
|
||||||
...
|
guild: InviteGuild
|
||||||
|
inviter: PartialUser
|
||||||
|
target_user: PartialUser
|
||||||
|
target_type: InviteTargetType
|
||||||
|
target_application: PartialAppInfo
|
||||||
|
guild_scheduled_event: GuildScheduledEvent
|
||||||
|
|
||||||
|
|
||||||
class InviteWithCounts(Invite, _GuildPreviewUnique):
|
class InviteWithCounts(Invite, _GuildPreviewUnique):
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
class _GatewayInviteCreateOptional(TypedDict, total=False):
|
class GatewayInviteCreate(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
inviter: PartialUser
|
|
||||||
target_type: InviteTargetType
|
|
||||||
target_user: PartialUser
|
|
||||||
target_application: PartialAppInfo
|
|
||||||
|
|
||||||
|
|
||||||
class GatewayInviteCreate(_GatewayInviteCreateOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
code: str
|
code: str
|
||||||
created_at: str
|
created_at: str
|
||||||
@ -92,15 +77,17 @@ class GatewayInviteCreate(_GatewayInviteCreateOptional):
|
|||||||
max_uses: int
|
max_uses: int
|
||||||
temporary: bool
|
temporary: bool
|
||||||
uses: bool
|
uses: bool
|
||||||
|
|
||||||
|
|
||||||
class _GatewayInviteDeleteOptional(TypedDict, total=False):
|
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
|
inviter: NotRequired[PartialUser]
|
||||||
|
target_type: NotRequired[InviteTargetType]
|
||||||
|
target_user: NotRequired[PartialUser]
|
||||||
|
target_application: NotRequired[PartialAppInfo]
|
||||||
|
|
||||||
|
|
||||||
class GatewayInviteDelete(_GatewayInviteDeleteOptional):
|
class GatewayInviteDelete(TypedDict):
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
code: str
|
code: str
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
GatewayInvite = Union[GatewayInviteCreate, GatewayInviteDelete]
|
GatewayInvite = Union[GatewayInviteCreate, GatewayInviteDelete]
|
||||||
|
@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict, Union
|
from typing import List, Literal, Optional, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake, SnowflakeList
|
from .snowflake import Snowflake, SnowflakeList
|
||||||
from .member import Member, UserWithMember
|
from .member import Member, UserWithMember
|
||||||
from .user import User
|
from .user import User
|
||||||
@ -36,12 +38,9 @@ from .interactions import MessageInteraction
|
|||||||
from .sticker import StickerItem
|
from .sticker import StickerItem
|
||||||
|
|
||||||
|
|
||||||
class _PartialMessageOptional(TypedDict, total=False):
|
class PartialMessage(TypedDict):
|
||||||
guild_id: Snowflake
|
|
||||||
|
|
||||||
|
|
||||||
class PartialMessage(_PartialMessageOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class ChannelMention(TypedDict):
|
class ChannelMention(TypedDict):
|
||||||
@ -57,21 +56,18 @@ class Reaction(TypedDict):
|
|||||||
emoji: PartialEmoji
|
emoji: PartialEmoji
|
||||||
|
|
||||||
|
|
||||||
class _AttachmentOptional(TypedDict, total=False):
|
class Attachment(TypedDict):
|
||||||
height: Optional[int]
|
|
||||||
width: Optional[int]
|
|
||||||
description: str
|
|
||||||
content_type: str
|
|
||||||
spoiler: bool
|
|
||||||
ephemeral: bool
|
|
||||||
|
|
||||||
|
|
||||||
class Attachment(_AttachmentOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
filename: str
|
filename: str
|
||||||
size: int
|
size: int
|
||||||
url: str
|
url: str
|
||||||
proxy_url: str
|
proxy_url: str
|
||||||
|
height: NotRequired[Optional[int]]
|
||||||
|
width: NotRequired[Optional[int]]
|
||||||
|
description: NotRequired[str]
|
||||||
|
content_type: NotRequired[str]
|
||||||
|
spoiler: NotRequired[bool]
|
||||||
|
ephemeral: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
MessageActivityType = Literal[1, 2, 3, 5]
|
MessageActivityType = Literal[1, 2, 3, 5]
|
||||||
@ -82,15 +78,12 @@ class MessageActivity(TypedDict):
|
|||||||
party_id: str
|
party_id: str
|
||||||
|
|
||||||
|
|
||||||
class _MessageApplicationOptional(TypedDict, total=False):
|
class MessageApplication(TypedDict):
|
||||||
cover_image: str
|
|
||||||
|
|
||||||
|
|
||||||
class MessageApplication(_MessageApplicationOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
description: str
|
description: str
|
||||||
icon: Optional[str]
|
icon: Optional[str]
|
||||||
name: str
|
name: str
|
||||||
|
cover_image: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class MessageReference(TypedDict, total=False):
|
class MessageReference(TypedDict, total=False):
|
||||||
@ -100,30 +93,11 @@ class MessageReference(TypedDict, total=False):
|
|||||||
fail_if_not_exists: bool
|
fail_if_not_exists: bool
|
||||||
|
|
||||||
|
|
||||||
class _MessageOptional(TypedDict, total=False):
|
|
||||||
guild_id: Snowflake
|
|
||||||
member: Member
|
|
||||||
mention_channels: List[ChannelMention]
|
|
||||||
reactions: List[Reaction]
|
|
||||||
nonce: Union[int, str]
|
|
||||||
webhook_id: Snowflake
|
|
||||||
activity: MessageActivity
|
|
||||||
application: MessageApplication
|
|
||||||
application_id: Snowflake
|
|
||||||
message_reference: MessageReference
|
|
||||||
flags: int
|
|
||||||
sticker_items: List[StickerItem]
|
|
||||||
referenced_message: Optional[Message]
|
|
||||||
interaction: MessageInteraction
|
|
||||||
components: List[Component]
|
|
||||||
|
|
||||||
|
|
||||||
MessageType = Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 18, 19, 20, 21]
|
MessageType = Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 18, 19, 20, 21]
|
||||||
|
|
||||||
|
|
||||||
class Message(_MessageOptional):
|
class Message(PartialMessage):
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
channel_id: Snowflake
|
|
||||||
author: User
|
author: User
|
||||||
content: str
|
content: str
|
||||||
timestamp: str
|
timestamp: str
|
||||||
@ -136,6 +110,20 @@ class Message(_MessageOptional):
|
|||||||
embeds: List[Embed]
|
embeds: List[Embed]
|
||||||
pinned: bool
|
pinned: bool
|
||||||
type: MessageType
|
type: MessageType
|
||||||
|
member: NotRequired[Member]
|
||||||
|
mention_channels: NotRequired[List[ChannelMention]]
|
||||||
|
reactions: NotRequired[List[Reaction]]
|
||||||
|
nonce: NotRequired[Union[int, str]]
|
||||||
|
webhook_id: NotRequired[Snowflake]
|
||||||
|
activity: NotRequired[MessageActivity]
|
||||||
|
application: NotRequired[MessageApplication]
|
||||||
|
application_id: NotRequired[Snowflake]
|
||||||
|
message_reference: NotRequired[MessageReference]
|
||||||
|
flags: NotRequired[int]
|
||||||
|
sticker_items: NotRequired[List[StickerItem]]
|
||||||
|
referenced_message: NotRequired[Optional[Message]]
|
||||||
|
interaction: NotRequired[MessageInteraction]
|
||||||
|
components: NotRequired[List[Component]]
|
||||||
|
|
||||||
|
|
||||||
AllowedMentionType = Literal['roles', 'users', 'everyone']
|
AllowedMentionType = Literal['roles', 'users', 'everyone']
|
||||||
|
@ -25,16 +25,12 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TypedDict, Optional
|
from typing import TypedDict, Optional
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
|
|
||||||
|
|
||||||
class _RoleOptional(TypedDict, total=False):
|
class Role(TypedDict):
|
||||||
icon: Optional[str]
|
|
||||||
unicode_emoji: Optional[str]
|
|
||||||
tags: RoleTags
|
|
||||||
|
|
||||||
|
|
||||||
class Role(_RoleOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
name: str
|
name: str
|
||||||
color: int
|
color: int
|
||||||
@ -43,6 +39,9 @@ class Role(_RoleOptional):
|
|||||||
permissions: str
|
permissions: str
|
||||||
managed: bool
|
managed: bool
|
||||||
mentionable: bool
|
mentionable: bool
|
||||||
|
icon: NotRequired[Optional[str]]
|
||||||
|
unicode_emoji: NotRequired[Optional[str]]
|
||||||
|
tags: NotRequired[RoleTags]
|
||||||
|
|
||||||
|
|
||||||
class RoleTags(TypedDict, total=False):
|
class RoleTags(TypedDict, total=False):
|
||||||
|
@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict, Union
|
from typing import List, Literal, Optional, TypedDict, Union
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
from .user import User
|
from .user import User
|
||||||
@ -33,15 +34,7 @@ EventStatus = Literal[1, 2, 3, 4]
|
|||||||
EntityType = Literal[1, 2, 3]
|
EntityType = Literal[1, 2, 3]
|
||||||
|
|
||||||
|
|
||||||
class _BaseGuildScheduledEventOptional(TypedDict, total=False):
|
class _BaseGuildScheduledEvent(TypedDict):
|
||||||
creator_id: Optional[Snowflake]
|
|
||||||
description: Optional[str]
|
|
||||||
creator: User
|
|
||||||
user_count: int
|
|
||||||
image: Optional[str]
|
|
||||||
|
|
||||||
|
|
||||||
class _BaseGuildScheduledEvent(_BaseGuildScheduledEventOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
entity_id: Optional[Snowflake]
|
entity_id: Optional[Snowflake]
|
||||||
@ -49,15 +42,17 @@ class _BaseGuildScheduledEvent(_BaseGuildScheduledEventOptional):
|
|||||||
scheduled_start_time: str
|
scheduled_start_time: str
|
||||||
privacy_level: PrivacyLevel
|
privacy_level: PrivacyLevel
|
||||||
status: EventStatus
|
status: EventStatus
|
||||||
|
creator_id: NotRequired[Optional[Snowflake]]
|
||||||
|
description: NotRequired[Optional[str]]
|
||||||
|
creator: NotRequired[User]
|
||||||
|
user_count: NotRequired[int]
|
||||||
|
image: NotRequired[Optional[str]]
|
||||||
|
|
||||||
|
|
||||||
class _VoiceChannelScheduledEventOptional(_BaseGuildScheduledEvent, total=False):
|
class _VoiceChannelScheduledEvent(_BaseGuildScheduledEvent):
|
||||||
scheduled_end_time: Optional[str]
|
|
||||||
|
|
||||||
|
|
||||||
class _VoiceChannelScheduledEvent(_VoiceChannelScheduledEventOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
entity_metadata: Literal[None]
|
entity_metadata: Literal[None]
|
||||||
|
scheduled_end_time: NotRequired[Optional[str]]
|
||||||
|
|
||||||
|
|
||||||
class StageInstanceScheduledEvent(_VoiceChannelScheduledEvent):
|
class StageInstanceScheduledEvent(_VoiceChannelScheduledEvent):
|
||||||
|
@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Literal, TypedDict, Union, Optional
|
from typing import List, Literal, TypedDict, Union, Optional
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
from .user import User
|
from .user import User
|
||||||
|
|
||||||
@ -51,14 +53,11 @@ class StandardSticker(BaseSticker):
|
|||||||
pack_id: Snowflake
|
pack_id: Snowflake
|
||||||
|
|
||||||
|
|
||||||
class _GuildStickerOptional(TypedDict, total=False):
|
class GuildSticker(BaseSticker):
|
||||||
user: User
|
|
||||||
|
|
||||||
|
|
||||||
class GuildSticker(BaseSticker, _GuildStickerOptional):
|
|
||||||
type: Literal[2]
|
type: Literal[2]
|
||||||
available: bool
|
available: bool
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
|
user: NotRequired[User]
|
||||||
|
|
||||||
|
|
||||||
Sticker = Union[StandardSticker, GuildSticker]
|
Sticker = Union[StandardSticker, GuildSticker]
|
||||||
@ -74,19 +73,10 @@ class StickerPack(TypedDict):
|
|||||||
banner_asset_id: Optional[Snowflake]
|
banner_asset_id: Optional[Snowflake]
|
||||||
|
|
||||||
|
|
||||||
class _CreateGuildStickerOptional(TypedDict, total=False):
|
class CreateGuildSticker(TypedDict):
|
||||||
description: str
|
|
||||||
|
|
||||||
|
|
||||||
class CreateGuildSticker(_CreateGuildStickerOptional):
|
|
||||||
name: str
|
name: str
|
||||||
tags: str
|
tags: str
|
||||||
|
description: NotRequired[str]
|
||||||
|
|
||||||
class EditGuildSticker(TypedDict, total=False):
|
|
||||||
name: str
|
|
||||||
tags: str
|
|
||||||
description: str
|
|
||||||
|
|
||||||
|
|
||||||
class ListPremiumStickerPacks(TypedDict):
|
class ListPremiumStickerPacks(TypedDict):
|
||||||
|
@ -23,7 +23,9 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import List, Literal, Optional, TypedDict
|
from typing import List, Literal, Optional, TypedDict
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
|
|
||||||
@ -38,26 +40,17 @@ class ThreadMember(TypedDict):
|
|||||||
flags: int
|
flags: int
|
||||||
|
|
||||||
|
|
||||||
class _ThreadMetadataOptional(TypedDict, total=False):
|
class ThreadMetadata(TypedDict):
|
||||||
archiver_id: Snowflake
|
|
||||||
locked: bool
|
|
||||||
invitable: bool
|
|
||||||
create_timestamp: str
|
|
||||||
|
|
||||||
|
|
||||||
class ThreadMetadata(_ThreadMetadataOptional):
|
|
||||||
archived: bool
|
archived: bool
|
||||||
auto_archive_duration: ThreadArchiveDuration
|
auto_archive_duration: ThreadArchiveDuration
|
||||||
archive_timestamp: str
|
archive_timestamp: str
|
||||||
|
archiver_id: NotRequired[Snowflake]
|
||||||
|
locked: NotRequired[bool]
|
||||||
|
invitable: NotRequired[bool]
|
||||||
|
create_timestamp: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class _ThreadOptional(TypedDict, total=False):
|
class Thread(TypedDict):
|
||||||
member: ThreadMember
|
|
||||||
last_message_id: Optional[Snowflake]
|
|
||||||
last_pin_timestamp: Optional[Snowflake]
|
|
||||||
|
|
||||||
|
|
||||||
class Thread(_ThreadOptional):
|
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
parent_id: Snowflake
|
parent_id: Snowflake
|
||||||
@ -68,6 +61,9 @@ class Thread(_ThreadOptional):
|
|||||||
message_count: int
|
message_count: int
|
||||||
rate_limit_per_user: int
|
rate_limit_per_user: int
|
||||||
thread_metadata: ThreadMetadata
|
thread_metadata: ThreadMetadata
|
||||||
|
member: NotRequired[ThreadMember]
|
||||||
|
last_message_id: NotRequired[Optional[Snowflake]]
|
||||||
|
last_pin_timestamp: NotRequired[Optional[Snowflake]]
|
||||||
|
|
||||||
|
|
||||||
class ThreadPaginationPayload(TypedDict):
|
class ThreadPaginationPayload(TypedDict):
|
||||||
|
@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Optional, TypedDict, List, Literal
|
from typing import Optional, TypedDict, List, Literal
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
from .member import MemberWithUser
|
from .member import MemberWithUser
|
||||||
|
|
||||||
@ -30,12 +32,7 @@ from .member import MemberWithUser
|
|||||||
SupportedModes = Literal['xsalsa20_poly1305_lite', 'xsalsa20_poly1305_suffix', 'xsalsa20_poly1305']
|
SupportedModes = Literal['xsalsa20_poly1305_lite', 'xsalsa20_poly1305_suffix', 'xsalsa20_poly1305']
|
||||||
|
|
||||||
|
|
||||||
class _PartialVoiceStateOptional(TypedDict, total=False):
|
class _VoiceState(TypedDict):
|
||||||
member: MemberWithUser
|
|
||||||
self_stream: bool
|
|
||||||
|
|
||||||
|
|
||||||
class _VoiceState(_PartialVoiceStateOptional):
|
|
||||||
user_id: Snowflake
|
user_id: Snowflake
|
||||||
session_id: str
|
session_id: str
|
||||||
deaf: bool
|
deaf: bool
|
||||||
@ -44,6 +41,8 @@ class _VoiceState(_PartialVoiceStateOptional):
|
|||||||
self_mute: bool
|
self_mute: bool
|
||||||
self_video: bool
|
self_video: bool
|
||||||
suppress: bool
|
suppress: bool
|
||||||
|
member: NotRequired[MemberWithUser]
|
||||||
|
self_stream: NotRequired[bool]
|
||||||
|
|
||||||
|
|
||||||
class GuildVoiceState(_VoiceState):
|
class GuildVoiceState(_VoiceState):
|
||||||
|
@ -23,7 +23,10 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Literal, Optional, TypedDict
|
from typing import Literal, Optional, TypedDict
|
||||||
|
from typing_extensions import NotRequired
|
||||||
|
|
||||||
from .snowflake import Snowflake
|
from .snowflake import Snowflake
|
||||||
from .user import User
|
from .user import User
|
||||||
from .channel import PartialChannel
|
from .channel import PartialChannel
|
||||||
@ -35,28 +38,22 @@ class SourceGuild(TypedDict):
|
|||||||
icon: str
|
icon: str
|
||||||
|
|
||||||
|
|
||||||
class _WebhookOptional(TypedDict, total=False):
|
|
||||||
guild_id: Snowflake
|
|
||||||
user: User
|
|
||||||
token: str
|
|
||||||
|
|
||||||
|
|
||||||
WebhookType = Literal[1, 2, 3]
|
WebhookType = Literal[1, 2, 3]
|
||||||
|
|
||||||
|
|
||||||
class _FollowerWebhookOptional(TypedDict, total=False):
|
class FollowerWebhook(TypedDict):
|
||||||
source_channel: PartialChannel
|
|
||||||
source_guild: SourceGuild
|
|
||||||
|
|
||||||
|
|
||||||
class FollowerWebhook(_FollowerWebhookOptional):
|
|
||||||
channel_id: Snowflake
|
channel_id: Snowflake
|
||||||
webhook_id: Snowflake
|
webhook_id: Snowflake
|
||||||
|
source_channel: NotRequired[PartialChannel]
|
||||||
|
source_guild: NotRequired[SourceGuild]
|
||||||
|
|
||||||
|
|
||||||
class PartialWebhook(_WebhookOptional):
|
class PartialWebhook(TypedDict):
|
||||||
id: Snowflake
|
id: Snowflake
|
||||||
type: WebhookType
|
type: WebhookType
|
||||||
|
guild_id: NotRequired[Snowflake]
|
||||||
|
user: NotRequired[User]
|
||||||
|
token: NotRequired[str]
|
||||||
|
|
||||||
|
|
||||||
class _FullWebhook(TypedDict, total=False):
|
class _FullWebhook(TypedDict, total=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user