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
parent
commit
b62ac0839e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      discord/connections.py
  2. 1
      discord/enums.py
  3. 1
      discord/types/user.py
  4. 6
      docs/api.rst

4
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):

1
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'

1
discord/types/user.py

@ -48,6 +48,7 @@ ConnectionType = Literal[
'epicgames',
'facebook',
'github',
'instagram',
'leagueoflegends',
'paypal',
'playstation',

6
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.

Loading…
Cancel
Save