40
40
from .role import Role
41
41
from .invite import Invite
42
42
from .file import File
43
- from .components import Button , SelectionMenu , ActionRow
43
+ from .components import Button , DropdownMenue , ActionRow
44
44
from .voice_client import VoiceClient , VoiceProtocol
45
45
from . import utils
46
46
@@ -936,7 +936,7 @@ async def _get_channel(self):
936
936
async def send (self , content = None , * , tts = False , embed = None , components = None , file = None ,
937
937
files = None , delete_after = None , nonce = None ,
938
938
allowed_mentions = None , reference = None ,
939
- mention_author = None , hidden = None , ** kwargs ):
939
+ mention_author = None ):
940
940
"""|coro|
941
941
942
942
Sends a message to the destination with the content given.
@@ -997,10 +997,6 @@ async def send(self, content=None, *, tts=False, embed=None, components=None, fi
997
997
998
998
.. versionadded:: 1.6
999
999
1000
- hidden: Optional[:class:`bool`]
1001
- If :bool:`True` the message will be only bee visible for the performer of the interaction.
1002
- If this isnt called within an :class:`RawInteractionCreateEvent` it will be ignored
1003
-
1004
1000
Raises
1005
1001
--------
1006
1002
~discord.HTTPException
@@ -1031,12 +1027,12 @@ async def send(self, content=None, *, tts=False, embed=None, components=None, fi
1031
1027
for component in ([components ] if not isinstance (components , list ) else components ):
1032
1028
if isinstance (component , Button ):
1033
1029
_components .extend (ActionRow (component ).sendable ())
1034
- elif isinstance (component , SelectionMenu ):
1035
- _components .extend ( ActionRow ( component ). sendable ())
1030
+ elif isinstance (component , DropdownMenue ):
1031
+ _components .append ( component . to_dict ())
1036
1032
elif isinstance (component , ActionRow ):
1037
1033
_components .extend (component .sendable ())
1038
1034
elif isinstance (component , list ):
1039
- _components .extend (ActionRow (* [obj for obj in component if any ( isinstance (obj , Button ) or isinstance ( obj , SelectionMenu ) )]).sendable ())
1035
+ _components .extend (ActionRow (* [obj for obj in component if isinstance (obj , Button )]).sendable ())
1040
1036
components = _components
1041
1037
1042
1038
if allowed_mentions is not None :
@@ -1060,34 +1056,14 @@ async def send(self, content=None, *, tts=False, embed=None, components=None, fi
1060
1056
if file is not None and files is not None :
1061
1057
raise InvalidArgument ('cannot pass both file and files parameter to send()' )
1062
1058
1063
- is_interaction_responce = kwargs .pop ('__is_interaction_responce' , None )
1064
- deferred = kwargs .pop ('__deferred' , False )
1065
- use_webhook = kwargs .pop ('__use_webhook' , False )
1066
- interaction_id = kwargs .pop ('__interaction_id' , None )
1067
- interaction_token = kwargs .pop ('__interaction_token' , None )
1068
- application_id = kwargs .pop ('__application_id' , None )
1069
- if is_interaction_responce == False or None :
1070
- hidden = None
1071
1059
if file is not None :
1072
1060
if not isinstance (file , File ):
1073
1061
raise InvalidArgument ('file parameter must be File' )
1074
1062
1075
1063
try :
1076
- if hidden is not None :
1077
- data = await state .http .send_interaction_response (use_webhook = use_webhook ,
1078
- interaction_id = interaction_id ,
1079
- token = interaction_token ,
1080
- application_id = application_id ,
1081
- deferred = deferred ,
1082
- files = [file ], allowed_mentions = allowed_mentions ,
1083
- content = content , tts = tts , embed = embed ,
1084
- components = components ,
1085
- nonce = nonce , message_reference = reference ,
1086
- flags = 64 if hidden else None )
1087
- else :
1088
- data = await state .http .send_files (channel .id , files = [file ], allowed_mentions = allowed_mentions ,
1089
- content = content , tts = tts , embed = embed , components = components ,
1090
- nonce = nonce , message_reference = reference )
1064
+ data = await state .http .send_files (channel .id , files = [file ], allowed_mentions = allowed_mentions ,
1065
+ content = content , tts = tts , embed = embed , components = components ,
1066
+ nonce = nonce , message_reference = reference )
1091
1067
finally :
1092
1068
file .close ()
1093
1069
@@ -1098,45 +1074,21 @@ async def send(self, content=None, *, tts=False, embed=None, components=None, fi
1098
1074
raise InvalidArgument ('files parameter must be a list of File' )
1099
1075
1100
1076
try :
1101
- if hidden is not None :
1102
- data = await state .http .send_interaction_response (use_webhook = use_webhook ,
1103
- interaction_id = interaction_id ,
1104
- token = interaction_token ,
1105
- application_id = application_id ,
1106
- deferred = deferred ,
1107
- files = file , allowed_mentions = allowed_mentions ,
1108
- content = content , tts = tts , embed = embed ,
1109
- components = components ,
1110
- nonce = nonce , message_reference = reference ,
1111
- flags = 64 if hidden else None )
1112
- else :
1113
- data = await state .http .send_files (channel .id , files = files , content = content , tts = tts ,
1114
- embed = embed , components = components , nonce = nonce ,
1115
- allowed_mentions = allowed_mentions , message_reference = reference )
1077
+ data = await state .http .send_files (channel .id , files = files , content = content , tts = tts ,
1078
+ embed = embed , components = components , nonce = nonce ,
1079
+ allowed_mentions = allowed_mentions , message_reference = reference )
1116
1080
finally :
1117
1081
for f in files :
1118
1082
f .close ()
1119
1083
else :
1120
- if hidden is not None :
1121
- data = await state .http .send_interaction_response (use_webhook = use_webhook ,
1122
- interaction_id = interaction_id ,
1123
- token = interaction_token ,
1124
- application_id = application_id ,
1125
- deferred = deferred , allowed_mentions = allowed_mentions ,
1126
- content = content , tts = tts , embed = embed ,
1127
- components = components ,
1128
- nonce = nonce , message_reference = reference ,
1129
- flags = 64 if hidden else None )
1130
- else :
1131
- data = await state .http .send_message (channel .id , content , tts = tts , embed = embed , components = components ,
1132
- nonce = nonce , allowed_mentions = allowed_mentions ,
1133
- message_reference = reference )
1134
- if not hidden is True :
1135
- ret = state .create_message (channel = channel , data = data )
1136
- if delete_after is not None and hidden is None :
1137
- await ret .delete (delay = delete_after )
1138
- return ret
1139
- return None
1084
+ data = await state .http .send_message (channel .id , content , tts = tts , embed = embed , components = components ,
1085
+ nonce = nonce , allowed_mentions = allowed_mentions ,
1086
+ message_reference = reference )
1087
+
1088
+ ret = state .create_message (channel = channel , data = data )
1089
+ if delete_after is not None :
1090
+ await ret .delete (delay = delete_after )
1091
+ return ret
1140
1092
1141
1093
async def trigger_typing (self ):
1142
1094
"""|coro|
0 commit comments