Skip to content

Commit

Permalink
Update custom_thumbnail.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gillzxo authored Sep 17, 2020
1 parent e378804 commit 9c569f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tobrot/plugins/custom_thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async def save_thumb_nail(client, message):
thumbnail_location,
str(message.from_user.id) + ".jpg"
)
ismgs = await message.reply_text("processing ...")
ismgs = await message.reply_text(" ")
if message.reply_to_message is not None:
if not os.path.isdir(thumbnail_location):
os.makedirs(thumbnail_location)
Expand All @@ -44,11 +44,11 @@ async def save_thumb_nail(client, message):
# https://pillow.readthedocs.io/en/3.1.x/reference/Image.html#create-thumbnails
os.remove(downloaded_file_name)
await ismgs.edit(
"Custom video / file thumbnail saved. " + \
"This image will be used in the upload, till /clearthumbnail."
""
""
)
else:
await message.edit("Reply to a photo to save custom thumbnail")
await message.edit(" ")


async def clear_thumb_nail(client, message):
Expand All @@ -60,7 +60,7 @@ async def clear_thumb_nail(client, message):
thumbnail_location,
str(message.from_user.id) + ".jpg"
)
ismgs = await message.reply_text("processing ...")
ismgs = await message.reply_text("")
if os.path.exists(thumb_image_path):
os.remove(thumb_image_path)
await ismgs.edit("✅ Custom thumbnail cleared succesfully.")
await ismgs.edit("")

0 comments on commit 9c569f3

Please sign in to comment.