mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-02 10:44:50 +00:00
Update memify.py
This commit is contained in:
parent
3ebaca8398
commit
2c1c7d0f15
1 changed files with 10 additions and 5 deletions
|
|
@ -128,11 +128,14 @@ async def draw_meme_text(image_path, text):
|
|||
)
|
||||
current_h += u_height + pad
|
||||
|
||||
webp_file = "memifymycatty.webp"
|
||||
webp_file = "misskatyfy.webp"
|
||||
png_file = "misskatyfy.png"
|
||||
new_size = (512, 512)
|
||||
img.resize(new_size)
|
||||
img.save(webp_file, "WebP")
|
||||
return webp_file
|
||||
img.save(png_file, "PNG")
|
||||
img.close()
|
||||
return webp_file, png_file
|
||||
|
||||
|
||||
@app.on_message(filters.command(["mmf"], COMMAND_HANDLER))
|
||||
|
|
@ -142,10 +145,12 @@ async def memify(client, message):
|
|||
if message.reply_to_message and (message.reply_to_message.sticker or message.reply_to_message.photo):
|
||||
try:
|
||||
file = await message.reply_to_message.download()
|
||||
res = await draw_meme_text(file, message.text.split(None, 1)[1].strip())
|
||||
await message.reply_sticker(res)
|
||||
webp, png = await draw_meme_text(file, message.text.split(None, 1)[1].strip())
|
||||
await message.reply_sticker(webp)
|
||||
await message.reply_document(png)
|
||||
try:
|
||||
hapus(res)
|
||||
hapus(webp)
|
||||
hapus(png)
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue