Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions discord/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def twitch_name(self) -> Optional[str]:
except KeyError:
return None
else:
return name[7:] if name[:7] == 'twitch:' else None
return name[7:] if name.startswith('twitch:') else None

def to_dict(self) -> Dict[str, Any]:
ret: Dict[str, Any] = {
Expand Down Expand Up @@ -684,7 +684,7 @@ def album(self) -> str:
def album_cover_url(self) -> str:
""":class:`str`: The album cover image URL from Spotify's CDN."""
large_image = self._assets.get('large_image', '')
if large_image[:8] != 'spotify:':
if not large_image.startswith('spotify:'):
return ''
album_image_id = large_image[8:]
return 'https://i.scdn.co/image/' + album_image_id
Expand Down