Skip to content

Commit ec79acf

Browse files
authored
Update interactions.py
1 parent e393212 commit ec79acf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

discord/interactions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -412,24 +412,24 @@ async def defer(self, *, ephemeral: bool = False) -> None:
412412
This interaction has already been responded to before.
413413
"""
414414
if self._responded:
415-
raise discord.InteractionResponded(self._parent)
415+
raise InteractionResponded(self._parent)
416416

417417
defer_type: int = 0
418418
data: Optional[Dict[str, Any]] = None
419419
parent = self._parent
420-
if parent.type is discord.InteractionType.component:
420+
if parent.type is InteractionType.component:
421421
if ephemeral:
422422
data = {'flags': 64}
423-
defer_type = discord.InteractionResponseType.deferred_channel_message.value
423+
defer_type = InteractionResponseType.deferred_channel_message.value
424424
else:
425-
defer_type = discord.InteractionResponseType.deferred_message_update.value
426-
elif parent.type is discord.InteractionType.application_command:
427-
defer_type = discord.InteractionResponseType.deferred_channel_message.value
425+
defer_type = InteractionResponseType.deferred_message_update.value
426+
elif parent.type is InteractionResponseType.application_command:
427+
defer_type = InteractionResponseType.deferred_channel_message.value
428428
if ephemeral:
429429
data = {'flags': 64}
430430

431431
if defer_type:
432-
adapter = discord.webhook.async_.async_context.get()
432+
adapter = async_context.get()
433433
await adapter.create_interaction_response(
434434
parent.id, parent.token, session=parent._session, type=defer_type, data=data
435435
)

0 commit comments

Comments
 (0)