@@ -839,17 +839,15 @@ async def defer(self, *, ephemeral: bool = False, invisible: bool = True) -> Non
839839 if defer_type :
840840 adapter = async_context .get ()
841841 http = parent ._state .http
842- callback_response : InteractionCallbackResponse = (
843- await self ._locked_response (
844- adapter .create_interaction_response (
845- parent .id ,
846- parent .token ,
847- session = parent ._session ,
848- type = defer_type ,
849- data = data ,
850- proxy = http .proxy ,
851- proxy_auth = http .proxy_auth ,
852- )
842+ callback_response : InteractionCallbackResponse = await self ._locked_response (
843+ adapter .create_interaction_response (
844+ parent .id ,
845+ parent .token ,
846+ session = parent ._session ,
847+ type = defer_type ,
848+ data = data ,
849+ proxy = http .proxy ,
850+ proxy_auth = http .proxy_auth ,
853851 )
854852 )
855853 self ._responded = True
@@ -876,24 +874,20 @@ async def pong(self) -> None:
876874 if parent .type is InteractionType .ping :
877875 adapter = async_context .get ()
878876 http = parent ._state .http
879- callback_response : InteractionCallbackResponse = (
880- await self ._locked_response (
881- adapter .create_interaction_response (
882- parent .id ,
883- parent .token ,
884- session = parent ._session ,
885- proxy = http .proxy ,
886- proxy_auth = http .proxy_auth ,
887- type = InteractionResponseType .pong .value ,
888- )
877+ callback_response : InteractionCallbackResponse = await self ._locked_response (
878+ adapter .create_interaction_response (
879+ parent .id ,
880+ parent .token ,
881+ session = parent ._session ,
882+ proxy = http .proxy ,
883+ proxy_auth = http .proxy_auth ,
884+ type = InteractionResponseType .pong .value ,
889885 )
890886 )
891887 self ._responded = True
892888 await self ._process_callback_response (callback_response )
893889
894- async def _process_callback_response (
895- self , callback_response : InteractionCallbackResponse
896- ):
890+ async def _process_callback_response (self , callback_response : InteractionCallbackResponse ):
897891 if callback_response .get ("resource" , {}).get ("message" ):
898892 # TODO: fix later to not raise?
899893 channel = self ._parent .channel
@@ -1041,18 +1035,16 @@ async def send_message(
10411035 adapter = async_context .get ()
10421036 http = parent ._state .http
10431037 try :
1044- callback_response : InteractionCallbackResponse = (
1045- await self ._locked_response (
1046- adapter .create_interaction_response (
1047- parent .id ,
1048- parent .token ,
1049- session = parent ._session ,
1050- type = InteractionResponseType .channel_message .value ,
1051- proxy = http .proxy ,
1052- proxy_auth = http .proxy_auth ,
1053- data = payload ,
1054- files = files ,
1055- )
1038+ callback_response : InteractionCallbackResponse = await self ._locked_response (
1039+ adapter .create_interaction_response (
1040+ parent .id ,
1041+ parent .token ,
1042+ session = parent ._session ,
1043+ type = InteractionResponseType .channel_message .value ,
1044+ proxy = http .proxy ,
1045+ proxy_auth = http .proxy_auth ,
1046+ data = payload ,
1047+ files = files ,
10561048 )
10571049 )
10581050 finally :
@@ -1201,18 +1193,16 @@ async def edit_message(
12011193 adapter = async_context .get ()
12021194 http = parent ._state .http
12031195 try :
1204- callback_response : InteractionCallbackResponse = (
1205- await self ._locked_response (
1206- adapter .create_interaction_response (
1207- parent .id ,
1208- parent .token ,
1209- session = parent ._session ,
1210- type = InteractionResponseType .message_update .value ,
1211- proxy = http .proxy ,
1212- proxy_auth = http .proxy_auth ,
1213- data = payload ,
1214- files = files ,
1215- )
1196+ callback_response : InteractionCallbackResponse = await self ._locked_response (
1197+ adapter .create_interaction_response (
1198+ parent .id ,
1199+ parent .token ,
1200+ session = parent ._session ,
1201+ type = InteractionResponseType .message_update .value ,
1202+ proxy = http .proxy ,
1203+ proxy_auth = http .proxy_auth ,
1204+ data = payload ,
1205+ files = files ,
12161206 )
12171207 )
12181208 finally :
@@ -1705,12 +1695,8 @@ class InteractionCallback:
17051695 """
17061696
17071697 def __init__ (self , data : InteractionCallbackPayload ):
1708- self ._response_message_loading : bool = data .get (
1709- "response_message_loading" , False
1710- )
1711- self ._response_message_ephemeral : bool = data .get (
1712- "response_message_ephemeral" , False
1713- )
1698+ self ._response_message_loading : bool = data .get ("response_message_loading" , False )
1699+ self ._response_message_ephemeral : bool = data .get ("response_message_ephemeral" , False )
17141700
17151701 def __repr__ (self ):
17161702 return (
0 commit comments