Deprecate non-bot methods

This commit is contained in:
Nadir Chowdhury
2021-02-23 08:36:37 +00:00
committed by GitHub
parent 1cbc537734
commit 427e387a2f
8 changed files with 126 additions and 5 deletions

View File

@@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
"""
from .enums import RelationshipType, try_enum
from . import utils
class Relationship:
"""Represents a relationship in Discord.
@@ -32,6 +33,8 @@ class Relationship:
A relationship is like a friendship, a person who is blocked, etc.
Only non-bot accounts can have relationships.
.. deprecated:: 1.7
Attributes
-----------
user: :class:`User`
@@ -50,11 +53,14 @@ class Relationship:
def __repr__(self):
return '<Relationship user={0.user!r} type={0.type!r}>'.format(self)
@utils.deprecated()
async def delete(self):
"""|coro|
Deletes the relationship.
.. deprecated:: 1.7
Raises
------
HTTPException
@@ -63,12 +69,15 @@ class Relationship:
await self._state.http.remove_relationship(self.user.id)
@utils.deprecated()
async def accept(self):
"""|coro|
Accepts the relationship request. e.g. accepting a
friend request.
.. deprecated:: 1.7
Raises
-------
HTTPException