Repository: interactions-py/interactions.py

Issue:
allowed_mentions differ from discord.py
discord.py [merges](https://github.com/Rapptz/discord.py/blob/d30fea5b0dcba9cd130026b56ec01e78bd788aff/discord/abc.py#L1262) the local `allowed_mentions` into the global `allowed_mentions`, where as discord-py-slash-commands uses the global `allowed_mentions` as a default value if the local `allowed_mentions` isn't set. ([InteractionContext.send](https://github.com/discord-py-slash-commands/discord-py-interactions/blob/859beb65c2744a5a4d3a422d647268dbe6502669/discord_slash/context.py#L195), [ComponentContext.edit_origin](https://github.com/discord-py-slash-commands/discord-py-interactions/blob/859beb65c2744a5a4d3a422d647268dbe6502669/discord_slash/context.py#L406), SlashMessage.edit [[SlashMessage._slash_edit](https://github.com/discord-py-slash-commands/discord-py-interactions/blob/a7f468b66137726a2535a9d62177f6e25a8f8d2f/discord_slash/model.py#L528)])


Discussion:

Resolving patch:
diff --git a/discord_slash/context.py b/discord_slash/context.py
--- a/discord_slash/context.py
+++ b/discord_slash/context.py
@@ -188,15 +188,22 @@ async def send(
                 "The top level of the components list must be made of ActionRows!"
             )
 
+        if allowed_mentions is not None:
+            if self.bot.allowed_mentions is not None:
+                allowed_mentions = self.bot.allowed_mentions.merge(allowed_mentions).to_dict()
+            else:
+                allowed_mentions = allowed_mentions.to_dict()
+        else:
+            if self.bot.allowed_mentions is not None:
+                allowed_mentions = self.bot.allowed_mentions.to_dict()
+            else:
+                allowed_mentions = {}
+
         base = {
             "content": content,
             "tts": tts,
             "embeds": [x.to_dict() for x in embeds] if embeds else [],
-            "allowed_mentions": allowed_mentions.to_dict()
-            if allowed_mentions
-            else self.bot.allowed_mentions.to_dict()
-            if self.bot.allowed_mentions
-            else {},
+            "allowed_mentions": allowed_mentions,
             "components": components or [],
         }
         if hidden:
@@ -402,13 +409,18 @@ async def edit_origin(self, **fields):
             _resp["embeds"] = [x.to_dict() for x in embeds]
 
         allowed_mentions = fields.get("allowed_mentions")
-        _resp["allowed_mentions"] = (
-            allowed_mentions.to_dict()
-            if allowed_mentions
-            else self.bot.allowed_mentions.to_dict()
-            if self.bot.allowed_mentions
-            else {}
-        )
+        if allowed_mentions is not None:
+            if self.bot.allowed_mentions is not None:
+                _resp["allowed_mentions"] = self.bot.allowed_mentions.merge(
+                    allowed_mentions
+                ).to_dict()
+            else:
+                _resp["allowed_mentions"] = allowed_mentions.to_dict()
+        else:
+            if self.bot.allowed_mentions is not None:
+                _resp["allowed_mentions"] = self.bot.allowed_mentions.to_dict()
+            else:
+                _resp["allowed_mentions"] = {}
 
         if not self.responded:
             if files and not self.deferred:
diff --git a/discord_slash/model.py b/discord_slash/model.py
--- a/discord_slash/model.py
+++ b/discord_slash/model.py
@@ -524,13 +524,18 @@ async def _slash_edit(self, **fields):
             _resp["embeds"] = [x.to_dict() for x in embeds]
 
         allowed_mentions = fields.get("allowed_mentions")
-        _resp["allowed_mentions"] = (
-            allowed_mentions.to_dict()
-            if allowed_mentions
-            else self._state.allowed_mentions.to_dict()
-            if self._state.allowed_mentions
-            else {}
-        )
+        if allowed_mentions is not None:
+            if self.bot.allowed_mentions is not None:
+                _resp["allowed_mentions"] = self.bot.allowed_mentions.merge(
+                    allowed_mentions
+                ).to_dict()
+            else:
+                _resp["allowed_mentions"] = allowed_mentions.to_dict()
+        else:
+            if self.bot.allowed_mentions is not None:
+                _resp["allowed_mentions"] = self.bot.allowed_mentions.to_dict()
+            else:
+                _resp["allowed_mentions"] = {}
 
         await self._http.edit(_resp, self.__interaction_token, self.id, files=files)
 


Test patch: