Skip to content

Commit

Permalink
Resize image before uploading in unlocks module
Browse files Browse the repository at this point in the history
  • Loading branch information
user838492843 committed Aug 2, 2020
1 parent 594edfb commit 8ebd2a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/unlocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By Priyam Kalra

import os

from PIL import Image


@client.on(register(func=lambda e: e.is_group))
Expand All @@ -22,14 +22,18 @@ async def watch(event):
downloaded_file_name
)
if os.path.exists(downloaded_file_name):
image = Image.open(downloaded_file_name)
sticker = image.resize((461, 499))
sticker.save(file_name)
await client.send_file(
event.chat_id,
downloaded_file_name,
file_name,
force_document=False,
supports_streaming=False,
allow_cache=False,
reply_to=reply,
)
os.remove(file_name)
os.remove(downloaded_file_name)

Config.HELPER.update({
Expand Down

0 comments on commit 8ebd2a8

Please sign in to comment.