mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Change Interaction.user to not be Optional
This has potential to be a breaking change and Discord could definitely royally screw this over in the future. However, as far as I can tell every interaction has either a User or a Member so this change should be kosher. I'm unaware of any interaction, even in the future, where this is not true. I hope these are not my famous last words.
This commit is contained in:
parent
45dc3d3df9
commit
41f2792ed9
@ -94,7 +94,7 @@ class Interaction(Generic[ClientT]):
|
|||||||
The channel ID the interaction was sent from.
|
The channel ID the interaction was sent from.
|
||||||
application_id: :class:`int`
|
application_id: :class:`int`
|
||||||
The application ID that the interaction was for.
|
The application ID that the interaction was for.
|
||||||
user: Optional[Union[:class:`User`, :class:`Member`]]
|
user: Union[:class:`User`, :class:`Member`]
|
||||||
The user or member that sent the interaction.
|
The user or member that sent the interaction.
|
||||||
message: Optional[:class:`Message`]
|
message: Optional[:class:`Message`]
|
||||||
The message that sent this interaction.
|
The message that sent this interaction.
|
||||||
@ -150,7 +150,7 @@ class Interaction(Generic[ClientT]):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
self.message = None
|
self.message = None
|
||||||
|
|
||||||
self.user: Optional[Union[User, Member]] = None
|
self.user: Union[User, Member] = MISSING
|
||||||
self._permissions: int = 0
|
self._permissions: int = 0
|
||||||
|
|
||||||
# TODO: there's a potential data loss here
|
# TODO: there's a potential data loss here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user