Skip to content

Commit

Permalink
Add some type-ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab committed Nov 8, 2024
1 parent 47c597c commit 08f5c0a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,33 +865,33 @@ def __init__(self, *, state: ConnectionState, guild: Optional[Guild], data: Mess

self.original_response_message_id: Optional[int] = None
try:
self.original_response_message_id = int(data['original_response_message_id'])
self.original_response_message_id = int(data['original_response_message_id']) # type: ignore # EAFP

Check warning on line 868 in discord/message.py

View workflow job for this annotation

GitHub Actions / check 3.x

Unnecessary "# type: ignore" comment
except KeyError:
pass

self.interacted_message_id: Optional[int] = None
try:
self.interacted_message_id = int(data['interacted_message_id'])
self.interacted_message_id = int(data['interacted_message_id']) # type: ignore # EAFP
except KeyError:
pass

self.modal_interaction: Optional[MessageInteractionMetadata] = None
try:
self.modal_interaction = MessageInteractionMetadata(
state=state, guild=guild, data=data['triggering_interaction_metadata']
state=state, guild=guild, data=data['triggering_interaction_metadata'] # type: ignore # EAFP
)
except KeyError:
pass

self.target_user: Optional[User] = None
try:
self.target_user = state.create_user(data['target_user'])
self.target_user = state.create_user(data['target_user']) # type: ignore # EAFP
except KeyError:
pass

self.target_message_id: Optional[int] = None
try:
self.target_message_id = int(data['target_message_id'])
self.target_message_id = int(data['target_message_id']) # type: ignore # EAFP
except KeyError:
pass

Expand Down

0 comments on commit 08f5c0a

Please sign in to comment.