From b62ac0839e0aa8004310ee68078de95f8d24f556 Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Tue, 25 Apr 2023 20:03:38 +0530 Subject: [PATCH] Add Instagram connection and update PartialConnection.url (#501) * add `instagram` to ConnectionType enum * update PartialConnection.url * update docs * [docs] add versionadded directive * update `ConnectionType` literal in types.user --- discord/connections.py | 4 ++++ discord/enums.py | 1 + discord/types/user.py | 1 + docs/api.rst | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/discord/connections.py b/discord/connections.py index f33ac7a7c..3809c4619 100644 --- a/discord/connections.py +++ b/discord/connections.py @@ -143,6 +143,10 @@ class PartialConnection: return f'https://github.com/{self.name}' elif self.type == ConnectionType.tiktok: return f'https://tiktok.com/@{self.name}' + elif self.type == ConnectionType.ebay: + return f'https://www.ebay.com/usr/{self.name}' + elif self.type == ConnectionType.instagram: + return f'https://www.instagram.com/{self.name}' class Connection(PartialConnection): diff --git a/discord/enums.py b/discord/enums.py index c2cf7a5f5..f7eccc03f 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -1088,6 +1088,7 @@ class ConnectionType(Enum): epic_games = 'epicgames' facebook = 'facebook' github = 'github' + instagram = 'instagram' league_of_legends = 'leagueoflegends' paypal = 'paypal' playstation = 'playstation' diff --git a/discord/types/user.py b/discord/types/user.py index a69096752..c491713fe 100644 --- a/discord/types/user.py +++ b/discord/types/user.py @@ -48,6 +48,7 @@ ConnectionType = Literal[ 'epicgames', 'facebook', 'github', + 'instagram', 'leagueoflegends', 'paypal', 'playstation', diff --git a/docs/api.rst b/docs/api.rst index b20b69f7f..c7e3e5ff1 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -5273,6 +5273,12 @@ of :class:`enum.Enum`. The user has a GitHub connection. + .. attribute:: instagram + + The user has Instagram connection. + + .. versionadded:: 2.1 + .. attribute:: league_of_legends The user has a League of Legends connection.