Skip to content

Commit 0fc0afd

Browse files
authored
add client property to Interaction class (#1090)
1 parent 4514fe1 commit 0fc0afd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

discord/interactions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
TextChannel,
6060
VoiceChannel,
6161
)
62+
from .client import Client
6263
from .commands import OptionChoice
6364
from .embeds import Embed
6465
from .guild import Guild
@@ -81,7 +82,6 @@
8182
PartialMessageable,
8283
]
8384

84-
8585
MISSING: Any = utils.MISSING
8686

8787

@@ -189,6 +189,11 @@ def _from_data(self, data: InteractionPayload):
189189
except KeyError:
190190
pass
191191

192+
@property
193+
def client(self) -> Client:
194+
"""Returns the client that sent the interaction."""
195+
return self._state._get_client()
196+
192197
@property
193198
def guild(self) -> Optional[Guild]:
194199
"""Optional[:class:`Guild`]: The guild the interaction was sent from."""

0 commit comments

Comments
 (0)