Repository: hikari-py/hikari
Pull request #1152 (2022-05-02 23:45:49)

Removed AutocompleteInteraction.resolved
### Summary
Removed the `resolved` attribute from `AutocompleteInteraction` as autocomplete interactions never have resolved objects.

### Checklist
<!-- Make sure to tick all the following boxes by putting an `x` in between (like this `[x]`) -->
- [ ] I have run `nox` and all the pipelines have passed.
- [ ] I have made unittests according to the code I have added/modified/deleted.

### Related issues
<!--
To mention an issue use `#issue-id` and to mention a merge request use `!merge-request-id`
To close/fix an issue use `Close #issue-id` or `Fix #issue-id` (depending on the merge request)
-->



Patch:
diff --git a/changes/1152.breaking.md b/changes/1152.breaking.md
new file mode 100644
index 00000000..c648d298
--- /dev/null
+++ b/changes/1152.breaking.md
@@ -0,0 +1,1 @@
+Removed the `resolved` attribute from `AutocompleteInteraction` as autocomplete interactions never have resolved objects.
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 385433f4..ded0b486 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -29,7 +29,7 @@ sphobjinv==2.2.2
 #################
 
 mypy==0.950
-pyright==1.1.243
+pyright==1.1.244
 
 #######################
 # DEPENDENCY CHECKING #
diff --git a/hikari/impl/entity_factory.py b/hikari/impl/entity_factory.py
index 3b64a9e8..fc8b7d9d 100644
--- a/hikari/impl/entity_factory.py
+++ b/hikari/impl/entity_factory.py
@@ -2073,10 +2073,6 @@ def deserialize_autocomplete_interaction(
             member = None
             user = self.deserialize_user(payload["user"])
 
-        resolved: typing.Optional[command_interactions.ResolvedOptionData] = None
-        if resolved_payload := data_payload.get("resolved"):
-            resolved = self._deserialize_resolved_option_data(resolved_payload, guild_id=guild_id)
-
         return command_interactions.AutocompleteInteraction(
             app=self._app,
             application_id=snowflakes.Snowflake(payload["application_id"]),
@@ -2092,7 +2088,6 @@ def deserialize_autocomplete_interaction(
             command_name=data_payload["name"],
             command_type=commands.CommandType(data_payload.get("type", commands.CommandType.SLASH)),
             options=options,
-            resolved=resolved,
             locale=locales.Locale(payload["locale"]),
             guild_locale=locales.Locale(payload["guild_locale"]) if "guild_locale" in payload else None,
         )
diff --git a/hikari/interactions/command_interactions.py b/hikari/interactions/command_interactions.py
index ddebb1cc..12ffa95d 100644
--- a/hikari/interactions/command_interactions.py
+++ b/hikari/interactions/command_interactions.py
@@ -217,9 +217,6 @@ class BaseCommandInteraction(base_interactions.PartialInteraction):
     command_type: typing.Union[commands.CommandType, int] = attr.field(eq=False, hash=False, repr=True)
     """The type of the command."""
 
-    resolved: typing.Optional[ResolvedOptionData] = attr.field(eq=False, hash=False, repr=False)
-    """Mappings of the objects resolved for the provided command options."""
-
     async def fetch_channel(self) -> channels.TextableChannel:
         """Fetch the guild channel this was triggered in.
 
@@ -370,6 +367,9 @@ class CommandInteraction(BaseCommandInteraction, base_interactions.MessageRespon
     options: typing.Optional[typing.Sequence[CommandInteractionOption]] = attr.field(eq=False, hash=False, repr=True)
     """Parameter values provided by the user invoking this command."""
 
+    resolved: typing.Optional[ResolvedOptionData] = attr.field(eq=False, hash=False, repr=False)
+    """Mappings of the objects resolved for the provided command options."""
+
     target_id: typing.Optional[snowflakes.Snowflake] = attr.field(default=None, eq=False, hash=False, repr=True)
     """The target of the command. Only available if the command is a context menu command."""
 


Test patch:
diff --git a/tests/hikari/impl/test_entity_factory.py b/tests/hikari/impl/test_entity_factory.py
index 1cf56c9c..b8e449ff 100644
--- a/tests/hikari/impl/test_entity_factory.py
+++ b/tests/hikari/impl/test_entity_factory.py
@@ -3555,7 +3555,6 @@ def autocomplete_interaction_payload(self, user_payload, interaction_resolved_da
                         ],
                     },
                 ],
-                "resolved": interaction_resolved_data_payload,
             },
             "channel_id": "49949494",
             "user": user_payload,
@@ -3567,7 +3566,7 @@ def autocomplete_interaction_payload(self, user_payload, interaction_resolved_da
         }
 
     def test_deserialize_autocomplete_interaction(
-        self, entity_factory_impl, mock_app, autocomplete_interaction_payload, interaction_resolved_data_payload
+        self, entity_factory_impl, mock_app, autocomplete_interaction_payload
     ):
         interaction = entity_factory_impl.deserialize_autocomplete_interaction(autocomplete_interaction_payload)
 
@@ -3583,9 +3582,6 @@ def test_deserialize_autocomplete_interaction(
         assert interaction.locale is locales.Locale.ES_ES
         assert interaction.guild_locale == "en-US"
         assert interaction.guild_locale is locales.Locale.EN_US
-        assert interaction.resolved == entity_factory_impl._deserialize_resolved_option_data(
-            interaction_resolved_data_payload, guild_id=43123123
-        )
 
         # AutocompleteInteractionOption
         assert len(interaction.options) == 1
@@ -3617,7 +3613,6 @@ def test_deserialize_autocomplete_interaction(
     def test_deserialize_autocomplete_interaction_with_null_fields(
         self, entity_factory_impl, user_payload, mock_app, autocomplete_interaction_payload
     ):
-        del autocomplete_interaction_payload["data"]["resolved"]
         del autocomplete_interaction_payload["guild_locale"]
         del autocomplete_interaction_payload["guild_id"]
 
@@ -3626,7 +3621,6 @@ def test_deserialize_autocomplete_interaction_with_null_fields(
         assert interaction.guild_id is None
         assert interaction.member is None
         assert interaction.user == entity_factory_impl.deserialize_user(user_payload)
-        assert interaction.resolved is None
         assert interaction.guild_locale is None
 
     def test_deserialize_interaction_returns_expected_type(
diff --git a/tests/hikari/interactions/test_command_interactions.py b/tests/hikari/interactions/test_command_interactions.py
index 0cd383da..7b7cea68 100644
--- a/tests/hikari/interactions/test_command_interactions.py
+++ b/tests/hikari/interactions/test_command_interactions.py
@@ -113,7 +113,6 @@ def mock_autocomplete_interaction(self, mock_app):
             command_name="OKOKOK",
             command_type=1,
             options=[],
-            resolved=None,
         )
 
     @pytest.fixture()