Skip to content

Commit 27fc7db

Browse files
committed
chore: Apply suggestions from code review
1 parent 1cdbe30 commit 27fc7db

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

discord/interactions.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ async def pong(self) -> None:
924924
async def _process_callback_response(
925925
self, callback_response: InteractionCallbackResponse
926926
):
927-
if callback_response.get("resource") and callback_response["resource"].get(
927+
if callback_response.get("resource", {}).get(
928928
"message"
929929
):
930930
# TODO: fix later to not raise?
@@ -1411,10 +1411,18 @@ async def _locked_response(self, coro: Coroutine[Any, Any, Any]) -> Any:
14111411
coro: Coroutine[Any]
14121412
The coroutine to wrap.
14131413
1414+
Returns
1415+
-------
1416+
Any
1417+
The result of the coroutine.
1418+
14141419
Raises
14151420
------
14161421
InteractionResponded
14171422
This interaction has already been responded to before.
1423+
1424+
.. versionchanged:: 2.7
1425+
Return the result of the coroutine
14181426
"""
14191427
async with self._response_lock:
14201428
if self.is_done():

docs/api/models.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ Interactions
373373
.. autoclass:: AuthorizingIntegrationOwners()
374374
:members:
375375

376+
.. attributetable:: InteractionCallback
377+
378+
.. autoclass:: InteractionCallback()
379+
:members:
380+
376381
Message Components
377382
------------------
378383

0 commit comments

Comments
 (0)