Browse Source

Rename some attributes and remove Optional[bool]

pull/9957/head
DA-344 7 months ago
parent
commit
b2128ac15b
  1. 11
      discord/interactions.py

11
discord/interactions.py

@ -674,9 +674,9 @@ class InteractionCallback(Generic[ClientT]):
The resolved activity instance this interaction was invoked from. The resolved activity instance this interaction was invoked from.
response_message_id: Optional[:class:`int`] response_message_id: Optional[:class:`int`]
The message ID of the interaction response. The message ID of the interaction response.
response_message_loading: Optional[:class:`bool`] response_message_loading: :class:`bool`
Whether the response message showed the application was thinking. Whether the response message showed the application was thinking.
response_message_ephemeral: Optional[:class:`bool`] response_message_ephemeral: :class:`bool`
Whether the response message was ephemeral. Whether the response message was ephemeral.
response_message: Optional[:class:`InteractionMessage`] response_message: Optional[:class:`InteractionMessage`]
The resolved response message. The resolved response message.
@ -725,10 +725,9 @@ class InteractionCallback(Generic[ClientT]):
self.id: int = int(interaction['id']) self.id: int = int(interaction['id'])
self.interaction_type: InteractionType = try_enum(InteractionType, interaction['type']) self.interaction_type: InteractionType = try_enum(InteractionType, interaction['type'])
self.activity_instance_id: Optional[str] = interaction.get('activity_instance_id') self.activity_instance_id: Optional[str] = interaction.get('activity_instance_id')
response_id = interaction.get('response_message_id') self.response_message_id: Optional[int] = utils._get_as_snowflake(interaction, 'response_message_id')
self.response_message_id: Optional[int] = int(response_id) if response_id is not None else None self.response_message_thinking: bool = interaction.get('response_message_loading', False)
self.response_message_thinking: Optional[bool] = interaction.get('response_message_loading') self.response_message_ephemeral: bool = interaction.get('response_message_ephemeral', False)
self.response_message_ephemeral: Optional[bool] = interaction.get('response_message_ephemeral')
resource = data.get('resource', {}) resource = data.get('resource', {})
self.callback_type: Optional[InteractionResponseType] = None self.callback_type: Optional[InteractionResponseType] = None

Loading…
Cancel
Save