@@ -89,34 +89,32 @@ async def send(self,
89
89
90
90
async def edit (self ,
91
91
message_id : typing .Union [int , str ] = "@original" ,
92
- send_type : int = 4 ,
93
- text : str = "" ,
92
+ content : str = "" ,
94
93
embeds : typing .List [discord .Embed ] = None ,
95
- tts : bool = False ):
94
+ tts : bool = False ,
95
+ allowed_mentions : typing .List [discord .AllowedMentions ] = None ):
96
96
"""
97
97
Edits response of the slash command.
98
98
99
99
:param message_id: Response message ID. Default initial message.
100
- :param send_type: Type of the response. Refer Discord API DOCS for more info about types. Default ``4``.
101
- :type send_type: int
102
- :param text: Text of the response. Can be ``None``.
103
- :type text: str
100
+ :param content: Text of the response. Can be ``None``.
101
+ :type content: str
104
102
:param embeds: Embeds of the response. Maximum 10, can be empty.
105
103
:type embeds: List[discord.Embed]
106
104
:param tts: Whether to speak message using tts. Default ``False``.
107
105
:type tts: bool
106
+ :param allowed_mentions: AllowedMentions of the message.
107
+ :type allowed_mentions: List[discord.AllowedMentions]
108
108
:return: ``None``
109
109
"""
110
110
if embeds and len (embeds ) > 10 :
111
111
raise error .IncorrectFormat ("Embed must be 10 or fewer." )
112
112
base = {
113
- "type" : send_type ,
114
- "data" : {
115
- "tts" : tts ,
116
- "content" : text ,
117
- "embeds" : [x .to_dict () for x in embeds ] if embeds else [],
118
- "allowed_mentions" : []
119
- }
113
+ "content" : content ,
114
+ "tts" : tts ,
115
+ "embeds" : [x .to_dict () for x in embeds ] if embeds else [],
116
+ "allowed_mentions" : [x .to_dict () for x in allowed_mentions ] if allowed_mentions
117
+ else self ._discord .allowed_mentions .to_dict () if self ._discord .allowed_mentions else []
120
118
}
121
119
await self ._http .edit (base , self ._discord .user .id , self .__token , message_id )
122
120
0 commit comments