@@ -193,15 +193,22 @@ async def send(
193
193
"The top level of the components list must be made of ActionRows!"
194
194
)
195
195
196
+ if allowed_mentions is not None :
197
+ if self .bot .allowed_mentions is not None :
198
+ allowed_mentions = self .bot .allowed_mentions .merge (allowed_mentions ).to_dict ()
199
+ else :
200
+ allowed_mentions = allowed_mentions .to_dict ()
201
+ else :
202
+ if self .bot .allowed_mentions is not None :
203
+ allowed_mentions = self .bot .allowed_mentions .to_dict ()
204
+ else :
205
+ allowed_mentions = {}
206
+
196
207
base = {
197
208
"content" : content ,
198
209
"tts" : tts ,
199
210
"embeds" : [x .to_dict () for x in embeds ] if embeds else [],
200
- "allowed_mentions" : allowed_mentions .to_dict ()
201
- if allowed_mentions
202
- else self .bot .allowed_mentions .to_dict ()
203
- if self .bot .allowed_mentions
204
- else {},
211
+ "allowed_mentions" : allowed_mentions ,
205
212
"components" : components or [],
206
213
}
207
214
if hidden :
@@ -433,13 +440,18 @@ async def edit_origin(self, **fields):
433
440
files = [file ]
434
441
435
442
allowed_mentions = fields .get ("allowed_mentions" )
436
- _resp ["allowed_mentions" ] = (
437
- allowed_mentions .to_dict ()
438
- if allowed_mentions
439
- else self .bot .allowed_mentions .to_dict ()
440
- if self .bot .allowed_mentions
441
- else {}
442
- )
443
+ if allowed_mentions is not None :
444
+ if self .bot .allowed_mentions is not None :
445
+ _resp ["allowed_mentions" ] = self .bot .allowed_mentions .merge (
446
+ allowed_mentions
447
+ ).to_dict ()
448
+ else :
449
+ _resp ["allowed_mentions" ] = allowed_mentions .to_dict ()
450
+ else :
451
+ if self .bot .allowed_mentions is not None :
452
+ _resp ["allowed_mentions" ] = self .bot .allowed_mentions .to_dict ()
453
+ else :
454
+ _resp ["allowed_mentions" ] = {}
443
455
444
456
if not self .responded :
445
457
if files and not self .deferred :
0 commit comments