diff options
| author | Rapptz <[email protected]> | 2017-01-20 19:26:56 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-01-20 19:28:43 -0500 |
| commit | 4c981ee6315f43b28d99a84851d3f6138738a77f (patch) | |
| tree | 18c252f0c09b3eade7964d5c4941f52c7dc9906a /discord/http.py | |
| parent | Add ClientUser.premium boolean. (diff) | |
| download | discord.py-4c981ee6315f43b28d99a84851d3f6138738a77f.tar.xz discord.py-4c981ee6315f43b28d99a84851d3f6138738a77f.zip | |
Add support for relationships.
Diffstat (limited to 'discord/http.py')
| -rw-r--r-- | discord/http.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/discord/http.py b/discord/http.py index e4d48690..db6b2969 100644 --- a/discord/http.py +++ b/discord/http.py @@ -618,6 +618,29 @@ class HTTPClient: def move_member(self, user_id, guild_id, channel_id): return self.edit_member(guild_id=guild_id, user_id=user_id, channel_id=channel_id) + + # Relationship related + + def remove_relationship(self, user_id): + r = Route('DELETE', '/users/@me/relationships/{user_id}', user_id=user_id) + return self.request(r) + + def add_relationship(self, user_id, type=None): + r = Route('PUT', '/users/@me/relationships/{user_id}', user_id=user_id) + payload = {} + if type is not None: + payload['type'] = type + + return self.request(r, json=payload) + + def send_friend_request(self, username, discriminator): + r = Route('POST', '/users/@me/relationships') + payload = { + 'username': username, + 'discriminator': int(discriminator) + } + return self.request(r, json=payload) + # Misc def application_info(self): |