@@ -296,10 +296,13 @@ async def original_message(self) -> InteractionMessage:
296
296
raise ClientException ("Channel for message could not be resolved" )
297
297
298
298
adapter = async_context .get ()
299
+ http = self ._state .http
299
300
data = await adapter .get_original_interaction_response (
300
301
application_id = self .application_id ,
301
302
token = self .token ,
302
303
session = self ._session ,
304
+ proxy = http .proxy ,
305
+ proxy_auth = http .proxy_auth ,
303
306
)
304
307
state = _InteractionMessageState (self , self ._state )
305
308
message = InteractionMessage (state = state , channel = channel , data = data ) # type: ignore
@@ -387,10 +390,13 @@ async def edit_original_message(
387
390
previous_allowed_mentions = previous_mentions ,
388
391
)
389
392
adapter = async_context .get ()
393
+ http = self ._state .http
390
394
data = await adapter .edit_original_interaction_response (
391
395
self .application_id ,
392
396
self .token ,
393
397
session = self ._session ,
398
+ proxy = http .proxy ,
399
+ proxy_auth = http .proxy_auth ,
394
400
payload = params .payload ,
395
401
multipart = params .multipart ,
396
402
files = params .files ,
@@ -429,10 +435,13 @@ async def delete_original_message(self, *, delay: Optional[float] = None) -> Non
429
435
Deleted a message that is not yours.
430
436
"""
431
437
adapter = async_context .get ()
438
+ http = self ._state .http
432
439
func = adapter .delete_original_interaction_response (
433
440
self .application_id ,
434
441
self .token ,
435
442
session = self ._session ,
443
+ proxy = http .proxy ,
444
+ proxy_auth = http .proxy_auth ,
436
445
)
437
446
438
447
if delay is not None :
@@ -566,13 +575,16 @@ async def defer(self, *, ephemeral: bool = False, invisible: bool = True) -> Non
566
575
567
576
if defer_type :
568
577
adapter = async_context .get ()
578
+ http = parent ._state .http
569
579
await self ._locked_response (
570
580
adapter .create_interaction_response (
571
581
parent .id ,
572
582
parent .token ,
573
583
session = parent ._session ,
574
584
type = defer_type ,
575
585
data = data ,
586
+ proxy = http .proxy ,
587
+ proxy_auth = http .proxy_auth ,
576
588
)
577
589
)
578
590
self ._responded = True
@@ -597,11 +609,14 @@ async def pong(self) -> None:
597
609
parent = self ._parent
598
610
if parent .type is InteractionType .ping :
599
611
adapter = async_context .get ()
612
+ http = parent ._state .http
600
613
await self ._locked_response (
601
614
adapter .create_interaction_response (
602
615
parent .id ,
603
616
parent .token ,
604
617
session = parent ._session ,
618
+ proxy = http .proxy ,
619
+ proxy_auth = http .proxy_auth ,
605
620
type = InteractionResponseType .pong .value ,
606
621
)
607
622
)
@@ -723,13 +738,16 @@ async def send_message(
723
738
724
739
parent = self ._parent
725
740
adapter = async_context .get ()
741
+ http = parent ._state .http
726
742
try :
727
743
await self ._locked_response (
728
744
adapter .create_interaction_response (
729
745
parent .id ,
730
746
parent .token ,
731
747
session = parent ._session ,
732
748
type = InteractionResponseType .channel_message .value ,
749
+ proxy = http .proxy ,
750
+ proxy_auth = http .proxy_auth ,
733
751
data = payload ,
734
752
files = files ,
735
753
)
@@ -852,13 +870,16 @@ async def edit_message(
852
870
payload ["attachments" ] = [a .to_dict () for a in msg .attachments ]
853
871
854
872
adapter = async_context .get ()
873
+ http = parent ._state .http
855
874
try :
856
875
await self ._locked_response (
857
876
adapter .create_interaction_response (
858
877
parent .id ,
859
878
parent .token ,
860
879
session = parent ._session ,
861
880
type = InteractionResponseType .message_update .value ,
881
+ proxy = http .proxy ,
882
+ proxy_auth = http .proxy_auth ,
862
883
data = payload ,
863
884
files = files ,
864
885
)
@@ -906,11 +927,14 @@ async def send_autocomplete_result(
906
927
payload = {"choices" : [c .to_dict () for c in choices ]}
907
928
908
929
adapter = async_context .get ()
930
+ http = parent ._state .http
909
931
await self ._locked_response (
910
932
adapter .create_interaction_response (
911
933
parent .id ,
912
934
parent .token ,
913
935
session = parent ._session ,
936
+ proxy = http .proxy ,
937
+ proxy_auth = http .proxy_auth ,
914
938
type = InteractionResponseType .auto_complete_result .value ,
915
939
data = payload ,
916
940
)
@@ -938,13 +962,18 @@ async def send_modal(self, modal: Modal) -> Interaction:
938
962
if self ._responded :
939
963
raise InteractionResponded (self ._parent )
940
964
965
+ parent = self ._parent
966
+
941
967
payload = modal .to_dict ()
942
968
adapter = async_context .get ()
969
+ http = parent ._state .http
943
970
await self ._locked_response (
944
971
adapter .create_interaction_response (
945
- self ._parent .id ,
946
- self ._parent .token ,
947
- session = self ._parent ._session ,
972
+ parent .id ,
973
+ parent .token ,
974
+ session = parent ._session ,
975
+ proxy = http .proxy ,
976
+ proxy_auth = http .proxy_auth ,
948
977
type = InteractionResponseType .modal .value ,
949
978
data = payload ,
950
979
)
0 commit comments