mirror of
https://github.com/jarulsamy/Plex-Bot.git
synced 2024-08-19 15:01:55 +02:00
bugfix for missing thumbnail
This commit is contained in:
parent
069d88fd1e
commit
aa51cc4301
@ -399,11 +399,15 @@ class Plex(commands.Cog):
|
||||
ValueError: Unsupported type of embed {type_}
|
||||
"""
|
||||
# Grab the relevant thumbnail
|
||||
img_stream = requests.get(track.thumbUrl, stream=True).raw
|
||||
img = io.BytesIO(img_stream.read())
|
||||
if track.thumbUrl:
|
||||
img_stream = requests.get(track.thumbUrl, stream=True).raw
|
||||
img = io.BytesIO(img_stream.read())
|
||||
|
||||
# Attach to discord embed
|
||||
art_file = discord.File(img, filename="image0.png")
|
||||
else:
|
||||
art_file = None
|
||||
|
||||
# Attach to discord embed
|
||||
art_file = discord.File(img, filename="image0.png")
|
||||
# Get appropiate status message
|
||||
if type_ == "play":
|
||||
title = f"Now Playing - {track.title}"
|
||||
|
Loading…
Reference in New Issue
Block a user