mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Use __getitem__ to access channel_id in MessageReference payloads
This commit is contained in:
parent
e543abd950
commit
59ebfefbf4
@ -468,7 +468,7 @@ class MessageReference:
|
||||
def with_state(cls, state: ConnectionState, data: MessageReferencePayload) -> Self:
|
||||
self = cls.__new__(cls)
|
||||
self.message_id = utils._get_as_snowflake(data, 'message_id')
|
||||
self.channel_id = int(data.pop('channel_id'))
|
||||
self.channel_id = int(data['channel_id'])
|
||||
self.guild_id = utils._get_as_snowflake(data, 'guild_id')
|
||||
self.fail_if_not_exists = data.get('fail_if_not_exists', True)
|
||||
self._state = state
|
||||
|
@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Literal, Optional, TypedDict, Union
|
||||
from typing_extensions import NotRequired
|
||||
from typing_extensions import NotRequired, Required
|
||||
|
||||
from .snowflake import Snowflake, SnowflakeList
|
||||
from .member import Member, UserWithMember
|
||||
@ -88,7 +88,7 @@ class MessageApplication(TypedDict):
|
||||
|
||||
class MessageReference(TypedDict, total=False):
|
||||
message_id: Snowflake
|
||||
channel_id: Snowflake
|
||||
channel_id: Required[Snowflake]
|
||||
guild_id: Snowflake
|
||||
fail_if_not_exists: bool
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user