mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Add Interaction.extras for extraneous data
This commit is contained in:
parent
500bf77103
commit
acd4a0856e
@ -113,6 +113,10 @@ class Interaction:
|
||||
The locale of the user invoking the interaction.
|
||||
guild_locale: Optional[:class:`Locale`]
|
||||
The preferred locale of the guild the interaction was sent from, if any.
|
||||
extras: :class:`dict`
|
||||
A dictionary that can be used to store extraneous data for use during
|
||||
interaction processing. The library will not touch any values or keys
|
||||
within this dictionary.
|
||||
"""
|
||||
|
||||
__slots__: Tuple[str, ...] = (
|
||||
@ -128,6 +132,7 @@ class Interaction:
|
||||
'version',
|
||||
'locale',
|
||||
'guild_locale',
|
||||
'extras',
|
||||
'_permissions',
|
||||
'_state',
|
||||
'_client',
|
||||
@ -149,6 +154,7 @@ class Interaction:
|
||||
# This baton is used for extra data that might be useful for the lifecycle of
|
||||
# an interaction. This is mainly for internal purposes and it gives it a free-for-all slot.
|
||||
self._baton: Any = MISSING
|
||||
self.extras: Dict[Any, Any] = {}
|
||||
self._from_data(data)
|
||||
|
||||
def _from_data(self, data: InteractionPayload):
|
||||
|
Loading…
x
Reference in New Issue
Block a user