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_}
|
ValueError: Unsupported type of embed {type_}
|
||||||
"""
|
"""
|
||||||
# Grab the relevant thumbnail
|
# Grab the relevant thumbnail
|
||||||
img_stream = requests.get(track.thumbUrl, stream=True).raw
|
if track.thumbUrl:
|
||||||
img = io.BytesIO(img_stream.read())
|
img_stream = requests.get(track.thumbUrl, stream=True).raw
|
||||||
|
img = io.BytesIO(img_stream.read())
|
||||||
|
|
||||||
# Attach to discord embed
|
# Attach to discord embed
|
||||||
art_file = discord.File(img, filename="image0.png")
|
art_file = discord.File(img, filename="image0.png")
|
||||||
|
else:
|
||||||
|
art_file = None
|
||||||
|
|
||||||
# Get appropiate status message
|
# Get appropiate status message
|
||||||
if type_ == "play":
|
if type_ == "play":
|
||||||
title = f"Now Playing - {track.title}"
|
title = f"Now Playing - {track.title}"
|
||||||
|
Loading…
Reference in New Issue
Block a user