Browse Source
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
pull/10109/head
owocado
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
12 additions and
0 deletions
-
discord/connections.py
-
discord/enums.py
-
discord/types/user.py
-
docs/api.rst
|
|
@ -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): |
|
|
|
|
|
@ -1088,6 +1088,7 @@ class ConnectionType(Enum): |
|
|
|
epic_games = 'epicgames' |
|
|
|
facebook = 'facebook' |
|
|
|
github = 'github' |
|
|
|
instagram = 'instagram' |
|
|
|
league_of_legends = 'leagueoflegends' |
|
|
|
paypal = 'paypal' |
|
|
|
playstation = 'playstation' |
|
|
|
|
|
@ -48,6 +48,7 @@ ConnectionType = Literal[ |
|
|
|
'epicgames', |
|
|
|
'facebook', |
|
|
|
'github', |
|
|
|
'instagram', |
|
|
|
'leagueoflegends', |
|
|
|
'paypal', |
|
|
|
'playstation', |
|
|
|
|
|
@ -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. |
|
|
|