diff options
| author | Rapptz <[email protected]> | 2021-04-04 10:09:25 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-04-04 10:15:30 -0400 |
| commit | 54288879e28cc63eefce33311ec393a4eed476c4 (patch) | |
| tree | 5bada5e0d4f1c997773d7216d14b3338ac76f1fa /discord/relationship.py | |
| parent | Remove asyncio.Task subclass in preference to task names (diff) | |
| download | discord.py-54288879e28cc63eefce33311ec393a4eed476c4.tar.xz discord.py-54288879e28cc63eefce33311ec393a4eed476c4.zip | |
Remove userbot functionality
This has a lot of legacy and cruft so there may be some stuff I've
missed but this first pass is enough to get a clear separation.
Diffstat (limited to 'discord/relationship.py')
| -rw-r--r-- | discord/relationship.py | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/discord/relationship.py b/discord/relationship.py deleted file mode 100644 index f7a1c66d..00000000 --- a/discord/relationship.py +++ /dev/null @@ -1,85 +0,0 @@ -""" -The MIT License (MIT) - -Copyright (c) 2015-present Rapptz - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. -""" - -from .enums import RelationshipType, try_enum -from . import utils - -class Relationship: - """Represents a relationship in Discord. - - 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` - The user you have the relationship with. - type: :class:`RelationshipType` - The type of relationship you have. - """ - - __slots__ = ('type', 'user', '_state') - - def __init__(self, *, state, data): - self._state = state - self.type = try_enum(RelationshipType, data['type']) - self.user = state.store_user(data['user']) - - 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 - Deleting the relationship failed. - """ - - 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 - Accepting the relationship failed. - """ - - await self._state.http.add_relationship(self.user.id) |