@@ -193,15 +193,22 @@ async def send(
193193 "The top level of the components list must be made of ActionRows!"
194194 )
195195
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+
196207 base = {
197208 "content" : content ,
198209 "tts" : tts ,
199210 "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 ,
205212 "components" : components or [],
206213 }
207214 if hidden :
@@ -433,13 +440,18 @@ async def edit_origin(self, **fields):
433440 files = [file ]
434441
435442 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" ] = {}
443455
444456 if not self .responded :
445457 if files and not self .deferred :
0 commit comments