Repository: hikari-py/hikari
Pull request #1347 (2022-11-06 16:38:49)

Remove previously deprecated functionality
### Checklist
<!-- Make sure to tick all the following boxes by putting an `x` in between (like this `[x]`) -->
- [x] I have run `nox` and all the pipelines have passed.
- [x] I have made unittests according to the code I have added/modified/deleted.




Patch:
diff --git a/changes/1347.breaking.md b/changes/1347.breaking.md
new file mode 100644
index 00000000..2847ee0c
--- /dev/null
+++ b/changes/1347.breaking.md
@@ -0,0 +1,7 @@
+Remove previously deprecated functionality.
+
+This includes:
+- `Message.mentions`
+- `nick` argument in rest methods
+- `edit_permission_overwrites`, `edit_my_nick` and `command_builder` rest methods
+- `CacheView.iterator`
diff --git a/hikari/guilds.py b/hikari/guilds.py
index 669a26fa..332cef37 100644
--- a/hikari/guilds.py
+++ b/hikari/guilds.py
@@ -66,7 +66,6 @@
 from hikari import urls
 from hikari import users
 from hikari.internal import attr_extensions
-from hikari.internal import deprecation
 from hikari.internal import enums
 from hikari.internal import routes
 from hikari.internal import time
@@ -902,7 +901,6 @@ async def edit(
         self,
         *,
         nickname: undefined.UndefinedNoneOr[str] = undefined.UNDEFINED,
-        nick: undefined.UndefinedNoneOr[str] = undefined.UNDEFINED,
         roles: undefined.UndefinedOr[snowflakes.SnowflakeishSequence[PartialRole]] = undefined.UNDEFINED,
         mute: undefined.UndefinedOr[bool] = undefined.UNDEFINED,
         deaf: undefined.UndefinedOr[bool] = undefined.UNDEFINED,
@@ -921,11 +919,6 @@ async def edit(
             will remove the members nick.
 
             Requires the `MANAGE_NICKNAMES` permission.
-        nick : hikari.undefined.UndefinedNoneOr[builtins.str]
-            Deprecated alias for `nickname`.
-
-            .. deprecated:: 2.0.0.dev104
-                Use `nickname` instead.
         roles : hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishSequence[hikari.guilds.PartialRole]]
             If provided, the new roles for the member.
 
@@ -989,14 +982,6 @@ async def edit(
         hikari.errors.InternalServerError
             If an internal error occurs on Discord while handling the request.
         """
-        if nick is not undefined.UNDEFINED:
-            deprecation.warn_deprecated(
-                "nick",
-                removal_version="2.0.0.dev113",
-                additional_info="Use 'nickname' parameter instead",
-            )
-            nickname = nick
-
         return await self.user.app.rest.edit_member(
             self.guild_id,
             self.user.id,
diff --git a/hikari/impl/entity_factory.py b/hikari/impl/entity_factory.py
index 6e07f4bd..d93d04ef 100644
--- a/hikari/impl/entity_factory.py
+++ b/hikari/impl/entity_factory.py
@@ -2767,7 +2767,7 @@ def deserialize_partial_message(  # noqa CFQ001 - Function too long
         if raw_role_mention_ids := payload.get("mention_roles"):
             role_mention_ids = [snowflakes.Snowflake(i) for i in raw_role_mention_ids]
 
-        message = message_models.PartialMessage(
+        return message_models.PartialMessage(
             app=self._app,
             id=snowflakes.Snowflake(payload["id"]),
             channel_id=snowflakes.Snowflake(payload["channel_id"]),
@@ -2798,14 +2798,8 @@ def deserialize_partial_message(  # noqa CFQ001 - Function too long
             user_mentions=user_mentions,
             role_mention_ids=role_mention_ids,
             mentions_everyone=payload.get("mention_everyone", undefined.UNDEFINED),
-            # We initialize these next.
-            mentions=NotImplemented,
         )
 
-        message.mentions = message_models.Mentions(message=message)
-
-        return message
-
     def deserialize_message(
         self, payload: data_binding.JSONObject
     ) -> message_models.Message:  # noqa CFQ001 - Function too long
@@ -2869,7 +2863,7 @@ def deserialize_message(
         role_mention_ids = [snowflakes.Snowflake(i) for i in payload.get("mention_roles", ())]
         channel_mentions = {u.id: u for u in map(self.deserialize_partial_channel, payload.get("mention_channels", ()))}
 
-        message = message_models.Message(
+        return message_models.Message(
             app=self._app,
             id=snowflakes.Snowflake(payload["id"]),
             channel_id=snowflakes.Snowflake(payload["channel_id"]),
@@ -2900,14 +2894,8 @@ def deserialize_message(
             channel_mentions=channel_mentions,
             role_mention_ids=role_mention_ids,
             mentions_everyone=payload.get("mention_everyone", False),
-            # We initialize these next.
-            mentions=NotImplemented,
         )
 
-        message.mentions = message_models.Mentions(message=message)
-
-        return message
-
     ###################
     # PRESENCE MODELS #
     ###################
diff --git a/hikari/impl/rest.py b/hikari/impl/rest.py
index 85c843c5..6520ddfb 100644
--- a/hikari/impl/rest.py
+++ b/hikari/impl/rest.py
@@ -75,7 +75,6 @@
 from hikari.impl import special_endpoints as special_endpoints_impl
 from hikari.interactions import base_interactions
 from hikari.internal import data_binding
-from hikari.internal import deprecation
 from hikari.internal import mentions
 from hikari.internal import net
 from hikari.internal import routes
@@ -1088,82 +1087,6 @@ async def edit_permission_overwrite(
         body.put("deny", deny)
         await self._request(route, json=body, reason=reason)
 
-    async def edit_permission_overwrites(
-        self,
-        channel: snowflakes.SnowflakeishOr[channels_.GuildChannel],
-        target: typing.Union[
-            snowflakes.Snowflakeish, users.PartialUser, guilds.PartialRole, channels_.PermissionOverwrite
-        ],
-        *,
-        target_type: undefined.UndefinedOr[typing.Union[channels_.PermissionOverwriteType, int]] = undefined.UNDEFINED,
-        allow: undefined.UndefinedOr[permissions_.Permissions] = undefined.UNDEFINED,
-        deny: undefined.UndefinedOr[permissions_.Permissions] = undefined.UNDEFINED,
-        reason: undefined.UndefinedOr[str] = undefined.UNDEFINED,
-    ) -> None:
-        """Edit permissions for a specific entity in the given guild channel.
-
-        .. deprecated:: 2.0.0.dev110
-            Use `RESTClient.edit_permission_overwrite` instead.
-
-        Parameters
-        ----------
-        channel : hikari.snowflakes.SnowflakeishOr[hikari.channels.GuildChannel]
-            The channel to edit a permission overwrite in. This may be the
-            object, or the ID of an existing channel.
-        target : typing.Union[hikari.users.PartialUser, hikari.guilds.PartialRole, hikari.channels.PermissionOverwrite, hikari.snowflakes.Snowflakeish]
-            The channel overwrite to edit. This may be the object or the ID of an
-            existing overwrite.
-
-        Other Parameters
-        ----------------
-        target_type : hikari.undefined.UndefinedOr[typing.Union[hikari.channels.PermissionOverwriteType, int]]
-            If provided, the type of the target to update. If unset, will attempt to get
-            the type from `target`.
-        allow : hikari.undefined.UndefinedOr[hikari.permissions.Permissions]
-            If provided, the new value of all allowed permissions.
-        deny : hikari.undefined.UndefinedOr[hikari.permissions.Permissions]
-            If provided, the new value of all disallowed permissions.
-        reason : hikari.undefined.UndefinedOr[builtins.str]
-            If provided, the reason that will be recorded in the audit logs.
-            Maximum of 512 characters.
-
-        Raises
-        ------
-        builtins.TypeError
-            If `target_type` is unset and we were unable to determine the type
-            from `target`.
-        hikari.errors.BadRequestError
-            If any of the fields that are passed have an invalid value.
-        hikari.errors.UnauthorizedError
-            If you are unauthorized to make the request (invalid/missing token).
-        hikari.errors.ForbiddenError
-            If you are missing the `MANAGE_PERMISSIONS` permission in the channel.
-        hikari.errors.NotFoundError
-            If the channel is not found or the target is not found if it is
-            a role.
-        hikari.errors.RateLimitTooLongError
-            Raised in the event that a rate limit occurs that is
-            longer than `max_rate_limit` when making a request.
-        hikari.errors.RateLimitedError
-            Usually, Hikari will handle and retry on hitting
-            rate-limits automatically. This includes most bucket-specific
-            rate-limits and global rate-limits. In some rare edge cases,
-            however, Discord implements other undocumented rules for
-            rate-limiting, such as limits per attribute. These cannot be
-            detected or handled normally by Hikari due to their undocumented
-            nature, and will trigger this exception if they occur.
-        hikari.errors.InternalServerError
-            If an internal error occurs on Discord while handling the request.
-        """  # noqa: E501 - Line too long
-        deprecation.warn_deprecated(
-            "edit_permission_overwrites",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'edit_permission_overwrite' instead",
-        )
-        await self.edit_permission_overwrite(
-            channel, target, target_type=target_type, allow=allow, deny=deny, reason=reason
-        )
-
     async def delete_permission_overwrite(
         self,
         channel: snowflakes.SnowflakeishOr[channels_.GuildChannel],
@@ -2169,92 +2092,6 @@ async def add_user_to_guild(
         mute: undefined.UndefinedOr[bool] = undefined.UNDEFINED,
         deaf: undefined.UndefinedOr[bool] = undefined.UNDEFINED,
     ) -> typing.Optional[guilds.Member]:
-        """Add a user to a guild.
-
-        !!! note
-            This requires the `access_token` to have the
-            `hikari.applications.OAuth2Scope.GUILDS_JOIN` scope enabled along
-            with the authorization of a Bot which has `MANAGE_INVITES`
-            permission within the target guild.
-
-        Parameters
-        ----------
-        access_token : typing.Union[builtins.str, hikari.applications.PartialOAuth2Token]
-            Object or string of the access token to use for this request.
-        guild : hikari.snowflakes.SnowflakeishOr[hikari.guilds.PartialGuild]
-            The guild to add the user to. This may be the object
-            or the ID of an existing guild.
-        user : hikari.snowflakes.SnowflakeishOr[hikari.users.PartialUser]
-            The user to add to the guild. This may be the object
-            or the ID of an existing user.
-
-        Other Parameters
-        ----------------
-        nickname : hikari.undefined.UndefinedOr[builtins.str]
-            If provided, the nick to add to the user when he joins the guild.
-
-            Requires the `MANAGE_NICKNAMES` permission on the guild.
-        nick : hikari.undefined.UndefinedNoneOr[builtins.str]
-            Deprecated alias for `nickname`.
-
-            .. deprecated:: 2.0.0.dev106
-                Use `nickname` instead.
-        roles : hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishSequence[hikari.guilds.PartialRole]]
-            If provided, the roles to add to the user when he joins the guild.
-            This may be a collection objects or IDs of existing roles.
-
-            Requires the `MANAGE_ROLES` permission on the guild.
-        mute : hikari.undefined.UndefinedOr[builtins.bool]
-            If provided, the mute state to add the user when he joins the guild.
-
-            Requires the `MUTE_MEMBERS` permission on the guild.
-        deaf : hikari.undefined.UndefinedOr[builtins.bool]
-            If provided, the deaf state to add the user when he joins the guild.
-
-            Requires the `DEAFEN_MEMBERS` permission on the guild.
-
-        Returns
-        -------
-        typing.Optional[hikari.guilds.Member]
-            `builtins.None` if the user was already part of the guild, else
-            `hikari.guilds.Member`.
-
-        Raises
-        ------
-        hikari.errors.BadRequestError
-            If any of the fields that are passed have an invalid value.
-        hikari.errors.ForbiddenError
-            If you are not part of the guild you want to add the user to,
-            if you are missing permissions to do one of the things you specified,
-            if you are using an access token for another user, if the token is
-            bound to another bot or if the access token doesn't have the
-            `hikari.applications.OAuth2Scope.GUILDS_JOIN` scope enabled.
-        hikari.errors.UnauthorizedError
-            If you are unauthorized to make the request (invalid/missing token).
-        hikari.errors.NotFoundError
-            If you own the guild or the user is not found.
-        hikari.errors.RateLimitTooLongError
-            Raised in the event that a rate limit occurs that is
-            longer than `max_rate_limit` when making a request.
-        hikari.errors.RateLimitedError
-            Usually, Hikari will handle and retry on hitting
-            rate-limits automatically. This includes most bucket-specific
-            rate-limits and global rate-limits. In some rare edge cases,
-            however, Discord implements other undocumented rules for
-            rate-limiting, such as limits per attribute. These cannot be
-            detected or handled normally by Hikari due to their undocumented
-            nature, and will trigger this exception if they occur.
-        hikari.errors.InternalServerError
-            If an internal error occurs on Discord while handling the request.
-        """
-        if nick is not undefined.UNDEFINED:
-            deprecation.warn_deprecated(
-                "nick",
-                removal_version="2.0.0.dev113",
-                additional_info="Use 'nickname' parameter instead",
-            )
-            nickname = nick
-
         route = routes.PUT_GUILD_MEMBER.compile(guild=guild, user=user)
         body = data_binding.JSONObjectBuilder()
         body.put("access_token", str(access_token))
@@ -3028,100 +2865,6 @@ async def edit_member(
         communication_disabled_until: undefined.UndefinedNoneOr[datetime.datetime] = undefined.UNDEFINED,
         reason: undefined.UndefinedOr[str] = undefined.UNDEFINED,
     ) -> guilds.Member:
-        """Edit a guild member.
-
-        Parameters
-        ----------
-        guild : hikari.snowflakes.SnowflakeishOr[hikari.guilds.PartialGuild]
-            The guild to edit. This may be the object
-            or the ID of an existing guild.
-        user : hikari.snowflakes.SnowflakeishOr[hikari.guilds.PartialGuild]
-            The guild to edit. This may be the object
-            or the ID of an existing guild.
-
-        Other Parameters
-        ----------------
-        nickname : hikari.undefined.UndefinedNoneOr[builtins.str]
-            If provided, the new nick for the member. If `builtins.None`,
-            will remove the members nick.
-
-            Requires the `MANAGE_NICKNAMES` permission.
-        nick : hikari.undefined.UndefinedNoneOr[builtins.str]
-            Deprecated alias for `nickname`.
-
-            .. deprecated:: 2.0.0.dev104
-                Use `nickname` instead.
-        roles : hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishSequence[hikari.guilds.PartialRole]]
-            If provided, the new roles for the member.
-
-            Requires the `MANAGE_ROLES` permission.
-        mute : hikari.undefined.UndefinedOr[builtins.bool]
-            If provided, the new server mute state for the member.
-
-            Requires the `MUTE_MEMBERS` permission.
-        deaf : hikari.undefined.UndefinedOr[builtins.bool]
-            If provided, the new server deaf state for the member.
-
-            Requires the `DEAFEN_MEMBERS` permission.
-        voice_channel : hikari.undefined.UndefinedOr[hikari.snowflakes.SnowflakeishOr[hikari.channels.GuildVoiceChannel]]]
-            If provided, `builtins.None` or the object or the ID of
-            an existing voice channel to move the member to.
-            If `builtins.None`, will disconnect the member from voice.
-
-            Requires the `MOVE_MEMBERS` permission and the `CONNECT`
-            permission in the original voice channel and the target
-            voice channel.
-
-            !!! note
-                If the member is not in a voice channel, this will
-                take no effect.
-        communication_disabled_until : hikari.undefined.UndefinedNoneOr[datetime.datetime]
-            If provided, the datetime when the timeout (disable communication)
-            of the member expires, up to 28 days in the future, or `builtins.None`
-            to remove the timeout from the member.
-
-            Requires the `MODERATE_MEMBERS` permission.
-        reason : hikari.undefined.UndefinedOr[builtins.str]
-            If provided, the reason that will be recorded in the audit logs.
-            Maximum of 512 characters.
-
-        Returns
-        -------
-        hikari.guilds.Member
-            Object of the member that was updated.
-
-        Raises
-        ------
-        hikari.errors.BadRequestError
-            If any of the fields that are passed have an invalid value.
-        hikari.errors.ForbiddenError
-            If you are missing a permission to do an action.
-        hikari.errors.UnauthorizedError
-            If you are unauthorized to make the request (invalid/missing token).
-        hikari.errors.NotFoundError
-            If the guild or the user are not found.
-        hikari.errors.RateLimitTooLongError
-            Raised in the event that a rate limit occurs that is
-            longer than `max_rate_limit` when making a request.
-        hikari.errors.RateLimitedError
-            Usually, Hikari will handle and retry on hitting
-            rate-limits automatically. This includes most bucket-specific
-            rate-limits and global rate-limits. In some rare edge cases,
-            however, Discord implements other undocumented rules for
-            rate-limiting, such as limits per attribute. These cannot be
-            detected or handled normally by Hikari due to their undocumented
-            nature, and will trigger this exception if they occur.
-        hikari.errors.InternalServerError
-            If an internal error occurs on Discord while handling the request.
-        """
-        if nick is not undefined.UNDEFINED:
-            deprecation.warn_deprecated(
-                "nick",
-                removal_version="2.0.0.dev113",
-                additional_info="Use 'nickname' parameter instead",
-            )
-            nickname = nick
-
         route = routes.PATCH_GUILD_MEMBER.compile(guild=guild, user=user)
         body = data_binding.JSONObjectBuilder()
         body.put("nick", nickname)
@@ -3158,62 +2901,6 @@ async def edit_my_member(
         assert isinstance(response, dict)
         return self._entity_factory.deserialize_member(response, guild_id=snowflakes.Snowflake(guild))
 
-    async def edit_my_nick(
-        self,
-        guild: snowflakes.SnowflakeishOr[guilds.Guild],
-        nick: typing.Optional[str],
-        *,
-        reason: undefined.UndefinedOr[str] = undefined.UNDEFINED,
-    ) -> None:
-        """Edit the associated token's member nick.
-
-        .. deprecated:: 2.0.0.dev104
-            Use `RESTClient.edit_my_member`'s `nick` argument instead.
-
-        Parameters
-        ----------
-        guild : hikari.snowflakes.SnowflakeishOr[hikari.guilds.PartialGuild]
-            The guild to edit. This may be the object
-            or the ID of an existing guild.
-        nick : typing.Optional[builtins.str]
-            The new nick. If `builtins.None`,
-            will remove the nick.
-
-        Other Parameters
-        ----------------
-        reason : hikari.undefined.UndefinedOr[builtins.str]
-            If provided, the reason that will be recorded in the audit logs.
-            Maximum of 512 characters.
-
-        Raises
-        ------
-        hikari.errors.ForbiddenError
-            If you are missing the `CHANGE_NICKNAME` permission.
-        hikari.errors.UnauthorizedError
-            If you are unauthorized to make the request (invalid/missing token).
-        hikari.errors.NotFoundError
-            If the guild is not found.
-        hikari.errors.RateLimitTooLongError
-            Raised in the event that a rate limit occurs that is
-            longer than `max_rate_limit` when making a request.
-        hikari.errors.RateLimitedError
-            Usually, Hikari will handle and retry on hitting
-            rate-limits automatically. This includes most bucket-specific
-            rate-limits and global rate-limits. In some rare edge cases,
-            however, Discord implements other undocumented rules for
-            rate-limiting, such as limits per attribute. These cannot be
-            detected or handled normally by Hikari due to their undocumented
-            nature, and will trigger this exception if they occur.
-        hikari.errors.InternalServerError
-            If an internal error occurs on Discord while handling the request.
-        """
-        deprecation.warn_deprecated(
-            "edit_permission_overwrites",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'edit_my_member' with the nickname parameter instead.",
-        )
-        await self.edit_my_member(guild, nickname=nick, reason=reason)
-
     async def add_role_to_member(
         self,
         guild: snowflakes.SnowflakeishOr[guilds.PartialGuild],
@@ -3659,33 +3346,6 @@ async def delete_template(
         assert isinstance(response, dict)
         return self._entity_factory.deserialize_template(response)
 
-    def command_builder(self, name: str, description: str) -> special_endpoints.SlashCommandBuilder:
-        r"""Create a slash command builder to use in `RESTClient.set_application_commands`.
-
-        .. deprecated:: 2.0.0.dev106
-            Use `RESTClient.slash_command_builder` instead.
-
-        Parameters
-        ----------
-        name : builtins.str
-            The command's name. This should match the regex `^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$` in
-            Unicode mode and be lowercase.
-        description : builtins.str
-            The description to set for the command.
-            This should be inclusively between 1-100 characters in length.
-
-        Returns
-        -------
-        hikari.api.special_endpoints.SlashCommandBuilder
-            The created command builder object.
-        """
-        deprecation.warn_deprecated(
-            "command_builder",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'slash_command_builder' instead.",
-        )
-        return self.slash_command_builder(name, description)
-
     def slash_command_builder(self, name: str, description: str) -> special_endpoints.SlashCommandBuilder:
         return special_endpoints_impl.SlashCommandBuilder(name, description)
 
diff --git a/hikari/internal/cache.py b/hikari/internal/cache.py
index 7453d262..4b80d3e7 100644
--- a/hikari/internal/cache.py
+++ b/hikari/internal/cache.py
@@ -56,7 +56,6 @@
 from hikari import emojis
 from hikari import guilds
 from hikari import invites
-from hikari import iterators
 from hikari import messages
 from hikari import presences
 from hikari import snowflakes
@@ -66,7 +65,6 @@
 from hikari.api import cache
 from hikari.internal import attr_extensions
 from hikari.internal import collections
-from hikari.internal import deprecation
 
 if typing.TYPE_CHECKING:
     from hikari import applications
@@ -156,14 +154,6 @@ def get_item_at(self, index: slice, /) -> typing.Sequence[ValueT]:
     def get_item_at(self, index: typing.Union[slice, int], /) -> typing.Union[ValueT, typing.Sequence[ValueT]]:
         return collections.get_index_or_slice(self, index)
 
-    def iterator(self) -> iterators.LazyIterator[ValueT]:
-        deprecation.warn_deprecated(
-            "iterator",
-            removal_version="2.0.0.dev113",
-            additional_info="Use the 'itertools' module instead",
-        )
-        return iterators.FlatLazyIterator(self.values())
-
 
 class EmptyCacheView(cache.CacheView[typing.Any, typing.Any]):
     """An empty cache view implementation."""
@@ -185,14 +175,6 @@ def __len__(self) -> typing.Literal[0]:
     def get_item_at(self, index: typing.Union[slice, int]) -> typing.NoReturn:
         raise IndexError(index)
 
-    def iterator(self) -> iterators.LazyIterator[ValueT]:
-        deprecation.warn_deprecated(
-            "iterator",
-            removal_version="2.0.0.dev113",
-            additional_info="Use the 'itertools' module instead",
-        )
-        return iterators.FlatLazyIterator(())
-
 
 @attr_extensions.with_copy
 @attr.define(repr=False, hash=False, weakref_slot=False)
@@ -854,7 +836,7 @@ def build_entity(self, app: traits.RESTAware, /) -> messages.Message:
             else undefined.UNDEFINED
         )
 
-        message = messages.Message(
+        return messages.Message(
             id=self.id,
             app=app,
             channel_id=self.channel_id,
@@ -865,7 +847,6 @@ def build_entity(self, app: traits.RESTAware, /) -> messages.Message:
             timestamp=self.timestamp,
             edited_timestamp=self.edited_timestamp,
             is_tts=self.is_tts,
-            mentions=NotImplemented,
             user_mentions=user_mentions,
             channel_mentions=channel_mentions,
             role_mention_ids=copy.copy(self.role_mention_ids),
@@ -887,8 +868,6 @@ def build_entity(self, app: traits.RESTAware, /) -> messages.Message:
             application_id=self.application_id,
             components=self.components,
         )
-        message.mentions = messages.Mentions(message=message)
-        return message
 
     def update(
         self,
diff --git a/hikari/messages.py b/hikari/messages.py
index 866a39c1..2dbc1569 100644
--- a/hikari/messages.py
+++ b/hikari/messages.py
@@ -31,7 +31,6 @@
     "Attachment",
     "Reaction",
     "MessageActivity",
-    "Mentions",
     "MessageInteraction",
     "MessageReference",
     "PartialMessage",
@@ -58,7 +57,6 @@
 from hikari import undefined
 from hikari import urls
 from hikari.internal import attr_extensions
-from hikari.internal import deprecation
 from hikari.internal import enums
 from hikari.internal import routes
 
@@ -271,137 +269,6 @@ class MessageActivity:
     """The party ID of the message activity."""
 
 
-@attr_extensions.with_copy
-@attr.define(hash=False, kw_only=True, weakref_slot=False)
-class Mentions:
-    """Description of mentions that exist in the message."""
-
-    # We refer back to the containing message so that we can provide info about
-    # entities that were not notified, and provide access to cached roles
-    # through this mechanism.
-    _message: PartialMessage = attr.field(repr=False)
-
-    @property
-    def channels(self) -> undefined.UndefinedOr[typing.Mapping[snowflakes.Snowflake, channels_.PartialChannel]]:
-        """Channel mentions that reference channels in the target crosspost's guild.
-
-        If the message is not crossposted, this will always be empty.
-        """
-        deprecation.warn_deprecated(
-            "channels",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'channel_mentions' in the base message object instead",
-        )
-        return self._message.channel_mentions
-
-    @property
-    def channels_ids(self) -> undefined.UndefinedOr[typing.Sequence[snowflakes.Snowflake]]:
-        """Sequence of IDs of the channels that were mentioned in the message."""
-        deprecation.warn_deprecated(
-            "channels_ids",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'channel_mention_ids' in the base message object instead",
-        )
-        return self._message.channel_mention_ids
-
-    @property
-    def users(self) -> undefined.UndefinedOr[typing.Mapping[snowflakes.Snowflake, users_.User]]:
-        """Users who were notified by their mention in the message."""
-        deprecation.warn_deprecated(
-            "users",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'user_mentions' in the base message object instead",
-        )
-        return self._message.user_mentions
-
-    @property
-    def user_ids(self) -> undefined.UndefinedOr[typing.Sequence[snowflakes.Snowflake]]:
-        """Sequence of IDs of the users that were mentioned in the message."""
-        deprecation.warn_deprecated(
-            "user_ids",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'user_mentions_ids' in the base message object instead",
-        )
-        return self._message.user_mentions_ids
-
-    @property
-    def role_ids(self) -> undefined.UndefinedOr[typing.Sequence[snowflakes.Snowflake]]:
-        """Sequence of IDs of roles that were notified by their mention in the message."""
-        deprecation.warn_deprecated(
-            "role_ids",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'role_mention_ids' in the base message object instead",
-        )
-        return self._message.role_mention_ids
-
-    @property
-    def everyone(self) -> undefined.UndefinedOr[bool]:
-        """Whether the message notifies using `@everyone` or `@here`."""
-        deprecation.warn_deprecated(
-            "everyone",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'mentions_everyone' in the base message object instead",
-        )
-        return self._message.mentions_everyone
-
-    def get_members(self) -> undefined.UndefinedOr[typing.Mapping[snowflakes.Snowflake, guilds.Member]]:
-        """Discover any cached members notified by this message.
-
-        If this message was sent in a DM, this will always be empty.
-
-        !!! warning
-            This will only return valid results on gateway events. For REST
-            endpoints, this will potentially be empty. This is a limitation of
-            Discord's API, as they do not consistently notify of the ID of the
-            guild a message was sent in.
-
-        !!! note
-            If you are using a stateless application such as a stateless bot
-            or a REST-only client, this will always be empty. Furthermore,
-            if you are running a stateful bot and have the GUILD_MEMBERS
-            intent disabled, this will also be empty.
-
-            Members that are not cached will not appear in this mapping. This
-            means that there is a very small chance that some users provided
-            in `notified_users` may not be present here.
-        """
-        deprecation.warn_deprecated(
-            "get_members",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'get_member_mentions' in the base message object instead",
-        )
-        return self._message.get_member_mentions()
-
-    def get_roles(self) -> undefined.UndefinedOr[typing.Mapping[snowflakes.Snowflake, guilds.Role]]:
-        """Attempt to look up the roles that are notified by this message.
-
-        If this message was sent in a DM, this will always be empty.
-
-        !!! warning
-            This will only return valid results on gateway events. For REST
-            endpoints, this will potentially be empty. This is a limitation of
-            Discord's API, as they do not consistently notify of the ID of the
-            guild a message was sent in.
-
-        !!! note
-            If you are using a stateless application such as a stateless bot
-            or a REST-only client, this will always be empty. Furthermore,
-            if you are running a stateful bot and have the GUILD intent
-            disabled, this will also be empty.
-
-            Roles that are not cached will not appear in this mapping. This
-            means that there is a very small chance that some role IDs provided
-            in `notifies_role_ids` may not be present here. This is a limitation
-            of Discord, again.
-        """
-        deprecation.warn_deprecated(
-            "get_roles",
-            removal_version="2.0.0.dev113",
-            additional_info="Use 'get_role_mentions' in the base message object instead",
-        )
-        return self._message.get_role_mentions()
-
-
 @attr_extensions.with_copy
 @attr.define(hash=False, kw_only=True, weakref_slot=False)
 class MessageReference:
@@ -817,16 +684,6 @@ class PartialMessage(snowflakes.Unique):
     is_tts: undefined.UndefinedOr[bool] = attr.field(hash=False, eq=False, repr=False)
     """Whether the message is a TTS message."""
 
-    mentions: Mentions = attr.field(hash=False, eq=False, repr=True)
-    """Description of who is mentioned in a message.
-
-    !!! warning
-        If the contents have not mutated and this is a message update event,
-        some fields that are not affected may be empty instead.
-
-        This is a Discord limitation.
-    """
-
     user_mentions: undefined.UndefinedOr[typing.Mapping[snowflakes.Snowflake, users_.User]] = attr.field(
         hash=False, eq=False, repr=False
     )


Test patch:
diff --git a/tests/hikari/impl/test_entity_factory.py b/tests/hikari/impl/test_entity_factory.py
index d11e68fd..d29aaa7f 100644
--- a/tests/hikari/impl/test_entity_factory.py
+++ b/tests/hikari/impl/test_entity_factory.py
@@ -5313,10 +5313,10 @@ def test_deserialize_partial_message(
             2020, 4, 21, 21, 20, 16, 510000, tzinfo=datetime.timezone.utc
         )
         assert partial_message.is_tts is True
-        assert partial_message.mentions.everyone is True
-        assert partial_message.mentions.user_ids == [5678]
-        assert partial_message.mentions.role_ids == [987]
-        assert partial_message.mentions.channels_ids == [456]
+        assert partial_message.mentions_everyone is True
+        assert partial_message.user_mentions_ids == [5678]
+        assert partial_message.role_mention_ids == [987]
+        assert partial_message.channel_mention_ids == [456]
         assert partial_message.attachments == [entity_factory_impl._deserialize_message_attachment(attachment_payload)]
 
         expected_embed = entity_factory_impl.deserialize_embed(embed_payload)
@@ -5410,10 +5410,10 @@ def test_deserialize_partial_message_with_unset_fields(self, entity_factory_impl
         assert partial_message.timestamp is undefined.UNDEFINED
         assert partial_message.edited_timestamp is undefined.UNDEFINED
         assert partial_message.is_tts is undefined.UNDEFINED
-        assert partial_message.mentions.everyone is undefined.UNDEFINED
-        assert partial_message.mentions.user_ids is undefined.UNDEFINED
-        assert partial_message.mentions.role_ids is undefined.UNDEFINED
-        assert partial_message.mentions.channels_ids is undefined.UNDEFINED
+        assert partial_message.mentions_everyone is undefined.UNDEFINED
+        assert partial_message.user_mentions_ids is undefined.UNDEFINED
+        assert partial_message.role_mention_ids is undefined.UNDEFINED
+        assert partial_message.channel_mention_ids is undefined.UNDEFINED
         assert partial_message.attachments is undefined.UNDEFINED
         assert partial_message.embeds is undefined.UNDEFINED
         assert partial_message.reactions is undefined.UNDEFINED
@@ -5479,10 +5479,11 @@ def test_deserialize_message(
             2020, 4, 21, 21, 20, 16, 510000, tzinfo=datetime.timezone.utc
         )
         assert message.is_tts is True
-        assert message.mentions.everyone is True
-        assert message.mentions.user_ids == [5678]
-        assert message.mentions.role_ids == [987]
-        assert message.mentions.channels_ids == [456]
+        assert message.mentions_everyone is True
+        assert message.user_mentions_ids == [5678]
+        assert message.role_mention_ids == [987]
+        assert message.channel_mention_ids == [456]
+
         # Attachment
         assert len(message.attachments) == 1
         attachment = message.attachments[0]
@@ -5498,6 +5499,7 @@ def test_deserialize_message(
 
         expected_embed = entity_factory_impl.deserialize_embed(embed_payload)
         assert message.embeds == [expected_embed]
+
         # Reaction
         reaction = message.reactions[0]
         assert reaction.count == 100
@@ -5562,7 +5564,7 @@ def test_deserialize_message_with_unset_sub_fields(self, entity_factory_impl, me
 
         message = entity_factory_impl.deserialize_message(message_payload)
 
-        assert message.mentions.channels == {}
+        assert message.channel_mentions == {}
 
         # Activity
         assert message.activity.party_id is None
@@ -5615,10 +5617,10 @@ def test_deserialize_message_with_null_and_unset_fields(
         assert message.guild_id is None
         assert message.member is None
         assert message.edited_timestamp is None
-        assert message.mentions.everyone is True
-        assert message.mentions.user_ids == []
-        assert message.mentions.role_ids == []
-        assert message.mentions.channels_ids == []
+        assert message.mentions_everyone is True
+        assert message.user_mentions_ids == []
+        assert message.role_mention_ids == []
+        assert message.channel_mention_ids == []
         assert message.attachments == []
         assert message.embeds == []
         assert message.reactions == []
diff --git a/tests/hikari/impl/test_rest.py b/tests/hikari/impl/test_rest.py
index c3d2cd6f..8184f9eb 100644
--- a/tests/hikari/impl/test_rest.py
+++ b/tests/hikari/impl/test_rest.py
@@ -24,7 +24,6 @@
 import datetime
 import http
 import typing
-import warnings
 
 import mock
 import pytest
@@ -1190,15 +1189,6 @@ def test_fetch_bans_when_start_at_undefined_and_newest_first(self, rest_client:
         )
         assert iterator is iterator_cls.return_value
 
-    def test_command_builder(self, rest_client):
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", category=DeprecationWarning)
-            result = rest_client.command_builder("a name", description="very very good")
-
-        assert isinstance(result, special_endpoints.SlashCommandBuilder)
-        assert result.name == "a name"
-        assert result.description == "very very good"
-
     def test_slash_command_builder(self, rest_client):
         result = rest_client.slash_command_builder("a name", "a description")
         assert isinstance(result, special_endpoints.SlashCommandBuilder)
@@ -2315,26 +2305,6 @@ async def test_edit_permission_overwrite(self, rest_client):
         )
         rest_client._request.assert_awaited_once_with(expected_route, json=expected_json, reason="cause why not :)")
 
-    async def test_edit_permission_overwrites(self, rest_client):
-        with mock.patch.object(rest_client, "edit_permission_overwrite") as edit_permission_overwrite:
-            await rest_client.edit_permission_overwrites(
-                StubModel(123),
-                StubModel(456),
-                target_type=channels.PermissionOverwriteType.MEMBER,
-                allow=permissions.Permissions.BAN_MEMBERS,
-                deny=permissions.Permissions.CREATE_INSTANT_INVITE,
-                reason="cause why not :)",
-            )
-
-        edit_permission_overwrite.assert_awaited_once_with(
-            StubModel(123),
-            StubModel(456),
-            target_type=channels.PermissionOverwriteType.MEMBER,
-            allow=permissions.Permissions.BAN_MEMBERS,
-            deny=permissions.Permissions.CREATE_INSTANT_INVITE,
-            reason="cause why not :)",
-        )
-
     @pytest.mark.parametrize(
         ("target", "expected_type"),
         [
@@ -3757,24 +3727,6 @@ async def test_add_user_to_guild(self, rest_client):
         rest_client._request.assert_awaited_once_with(expected_route, json=expected_json)
         rest_client._entity_factory.deserialize_member.assert_called_once_with({"id": "789"}, guild_id=123)
 
-    async def test_add_user_to_guild_with_deprecated_nick_field(self, rest_client):
-        member = StubModel(789)
-        expected_route = routes.PUT_GUILD_MEMBER.compile(guild=123, user=456)
-        expected_json = {"access_token": "token", "nick": "cool nick2"}
-        rest_client._request = mock.AsyncMock(return_value={"id": "789"})
-        rest_client._entity_factory.deserialize_member = mock.Mock(return_value=member)
-
-        returned = await rest_client.add_user_to_guild(
-            "token",
-            StubModel(123),
-            StubModel(456),
-            nick="cool nick2",
-        )
-
-        assert returned is member
-        rest_client._request.assert_awaited_once_with(expected_route, json=expected_json)
-        rest_client._entity_factory.deserialize_member.assert_called_once_with({"id": "789"}, guild_id=123)
-
     async def test_add_user_to_guild_when_already_in_guild(self, rest_client):
         expected_route = routes.PUT_GUILD_MEMBER.compile(guild=123, user=456)
         expected_json = {"access_token": "token"}
@@ -4640,20 +4592,6 @@ async def test_edit_member(self, rest_client):
         )
         rest_client._request.assert_awaited_once_with(expected_route, json=expected_json, reason="because i can")
 
-    async def test_edit_member_with_deprecated_nick_field(self, rest_client):
-        expected_route = routes.PATCH_GUILD_MEMBER.compile(guild=123, user=456)
-        expected_json = {"nick": "eeeeeestrogen"}
-        rest_client._request = mock.AsyncMock(return_value={"id": "789"})
-
-        result = await rest_client.edit_member(StubModel(123), StubModel(456), nick="eeeeeestrogen")
-
-        assert result is rest_client._entity_factory.deserialize_member.return_value
-
-        rest_client._entity_factory.deserialize_member.assert_called_once_with(
-            rest_client._request.return_value, guild_id=123
-        )
-        rest_client._request.assert_awaited_once_with(expected_route, json=expected_json, reason=undefined.UNDEFINED)
-
     async def test_edit_member_when_voice_channel_is_None(self, rest_client):
         expected_route = routes.PATCH_GUILD_MEMBER.compile(guild=123, user=456)
         expected_json = {"nick": "test", "roles": ["654", "321"], "mute": True, "deaf": False, "channel_id": None}
@@ -4731,19 +4669,6 @@ async def test_edit_my_member_without_optionals(self, rest_client):
         )
         rest_client._request.assert_awaited_once_with(expected_route, json={}, reason=undefined.UNDEFINED)
 
-    async def test_edit_my_nick(self, rest_client):
-        rest_client.edit_my_member = mock.AsyncMock()
-        rest_client._request = mock.AsyncMock()
-
-        with warnings.catch_warnings():
-            warnings.simplefilter("ignore", category=DeprecationWarning)
-            result = await rest_client.edit_my_nick(123, "hikari is the best", reason="because its true")
-
-        assert result is None
-        rest_client.edit_my_member.assert_awaited_once_with(
-            123, nickname="hikari is the best", reason="because its true"
-        )
-
     async def test_add_role_to_member(self, rest_client):
         expected_route = routes.PUT_GUILD_MEMBER_ROLE.compile(guild=123, user=456, role=789)
         rest_client._request = mock.AsyncMock()
diff --git a/tests/hikari/internal/test_cache.py b/tests/hikari/internal/test_cache.py
index 095313a5..76836ae2 100644
--- a/tests/hikari/internal/test_cache.py
+++ b/tests/hikari/internal/test_cache.py
@@ -22,9 +22,7 @@
 import copy
 
 import mock
-import pytest
 
-from hikari import iterators
 from hikari import snowflakes
 from hikari import stickers
 from hikari.internal import cache
@@ -75,28 +73,3 @@ def test_from_entity_when_user_not_passed(self) -> None:
         assert data.user is refcell.return_value
         mock_copy.assert_called_once_with(mock_user)
         refcell.assert_called_once_with(mock_copy.return_value)
-
-
-class TestCacheMappingView:
-    @pytest.fixture()
-    def cache_view(self):
-        return cache.CacheMappingView({"some": "data"})
-
-    def test_iterator(self, cache_view):
-        with mock.patch.object(iterators, "FlatLazyIterator") as flat_lazy_iterator:
-            with mock.patch.object(cache.CacheMappingView, "values") as values:
-                assert cache_view.iterator() is flat_lazy_iterator.return_value
-
-        flat_lazy_iterator.assert_called_once_with(values.return_value)
-
-
-class TestEmptyCacheView:
-    @pytest.fixture()
-    def cache_view(self):
-        return cache.EmptyCacheView()
-
-    def test_iterator(self, cache_view):
-        with mock.patch.object(iterators, "FlatLazyIterator") as flat_lazy_iterator:
-            assert cache_view.iterator() is flat_lazy_iterator.return_value
-
-        flat_lazy_iterator.assert_called_once_with(())
diff --git a/tests/hikari/test_guilds.py b/tests/hikari/test_guilds.py
index fab7987a..de4d3db4 100644
--- a/tests/hikari/test_guilds.py
+++ b/tests/hikari/test_guilds.py
@@ -452,25 +452,6 @@ async def test_edit(self, model):
 
         assert edit == model.app.rest.edit_member.return_value
 
-    @pytest.mark.asyncio()
-    async def test_edit_when_deprecated_nick_field(self, model):
-        model.app.rest.edit_member = mock.AsyncMock()
-
-        edit = await model.edit(nick="meow")
-
-        model.app.rest.edit_member.assert_awaited_once_with(
-            456,
-            123,
-            nickname="meow",
-            roles=undefined.UNDEFINED,
-            mute=undefined.UNDEFINED,
-            deaf=undefined.UNDEFINED,
-            voice_channel=undefined.UNDEFINED,
-            communication_disabled_until=undefined.UNDEFINED,
-            reason=undefined.UNDEFINED,
-        )
-        assert edit == model.app.rest.edit_member.return_value
-
     def test_default_avatar_url_property(self, model, mock_user):
         assert model.default_avatar_url is mock_user.default_avatar_url
 
diff --git a/tests/hikari/test_messages.py b/tests/hikari/test_messages.py
index e8c5bb4e..1aa1a1c3 100644
--- a/tests/hikari/test_messages.py
+++ b/tests/hikari/test_messages.py
@@ -127,7 +127,6 @@ def message():
         timestamp=datetime.datetime.now().astimezone(),
         edited_timestamp=None,
         is_tts=False,
-        mentions=messages.Mentions(message=mock.Mock()),
         user_mentions={},
         role_mention_ids=[],
         channel_mentions={},