Skip to content

Commit

Permalink
Update xtra_media.py
Browse files Browse the repository at this point in the history
  • Loading branch information
StarkGang authored Apr 19, 2021
1 parent e84afd4 commit 0d84d6d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/xtra_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
)
async def lgo(client, message):
pablo = await edit_or_reply(message, "`Processing...`")
if not message.reply_to_message or not message.reply_to_message.sticker:
if not message.reply_to_message:
await pablo.edit("Reply to A Animated Sticker...")
return
if not message.reply_to_message.sticker:
await pablo.edit("Reply to A Animated Sticker...")
return
if message.reply_to_message.sticker.mime_type != "application/x-tgsticker":
Expand All @@ -50,6 +53,10 @@ async def lgo(client, message):
lol = await message.reply_to_message.download("tgs.tgs")
cmdo = f"lottie_convert.py {lol} json.json"
await runcmd(cmdo)
if not os.path.exists('json.json'):
await pablo.edit("`Invalid Tgs Sticker I Suppose.`")
os.remove("tgs.tgs")
return
json = open("json.json", "r")
jsn = json.read()
json.close()
Expand Down

0 comments on commit 0d84d6d

Please sign in to comment.