Update Pyright to v1.1.394

This commit is contained in:
Rapptz
2025-02-18 03:16:51 -05:00
parent 1cdf710908
commit 8953938a53
30 changed files with 94 additions and 81 deletions

View File

@ -773,7 +773,7 @@ class MessageInteraction(Hashable):
self.user: Union[User, Member] = MISSING
try:
payload = data['member']
payload = data['member'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
self.user = state.create_user(data['user'])
else:
@ -2200,7 +2200,8 @@ class Message(PartialMessage, Hashable):
self.poll: Optional[Poll] = None
try:
self.poll = Poll._from_data(data=data['poll'], message=self, state=state)
poll = data['poll'] # pyright: ignore[reportTypedDictNotRequiredAccess]
self.poll = Poll._from_data(data=poll, message=self, state=state)
except KeyError:
pass
@ -2214,7 +2215,7 @@ class Message(PartialMessage, Hashable):
if self.guild is not None:
try:
thread = data['thread']
thread = data['thread'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
pass
else:
@ -2229,7 +2230,7 @@ class Message(PartialMessage, Hashable):
# deprecated
try:
interaction = data['interaction']
interaction = data['interaction'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
pass
else:
@ -2237,20 +2238,20 @@ class Message(PartialMessage, Hashable):
self.interaction_metadata: Optional[MessageInteractionMetadata] = None
try:
interaction_metadata = data['interaction_metadata']
interaction_metadata = data['interaction_metadata'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
pass
else:
self.interaction_metadata = MessageInteractionMetadata(state=state, guild=self.guild, data=interaction_metadata)
try:
ref = data['message_reference']
ref = data['message_reference'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
self.reference = None
else:
self.reference = ref = MessageReference.with_state(state, ref)
try:
resolved = data['referenced_message']
resolved = data['referenced_message'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
pass
else:
@ -2277,7 +2278,7 @@ class Message(PartialMessage, Hashable):
self.application: Optional[MessageApplication] = None
try:
application = data['application']
application = data['application'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
pass
else:
@ -2285,7 +2286,7 @@ class Message(PartialMessage, Hashable):
self.role_subscription: Optional[RoleSubscriptionInfo] = None
try:
role_subscription = data['role_subscription_data']
role_subscription = data['role_subscription_data'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
pass
else:
@ -2293,7 +2294,7 @@ class Message(PartialMessage, Hashable):
self.purchase_notification: Optional[PurchaseNotification] = None
try:
purchase_notification = data['purchase_notification']
purchase_notification = data['purchase_notification'] # pyright: ignore[reportTypedDictNotRequiredAccess]
except KeyError:
pass
else:
@ -2301,7 +2302,7 @@ class Message(PartialMessage, Hashable):
for handler in ('author', 'member', 'mentions', 'mention_roles', 'components', 'call'):
try:
getattr(self, f'_handle_{handler}')(data[handler])
getattr(self, f'_handle_{handler}')(data[handler]) # type: ignore
except KeyError:
continue