async def sticker_image(_, message: Message): r = message.reply_to_message if not r: return await message.reply("Reply to a sticker.") if not r.sticker: return await message.reply("Reply to a sticker.") m = await message.reply("Sending..") f = await r.download(f"{r.sticker.file_unique_id}.png") await gather(*[ message.reply_photo(f), message.reply_document(f), ]) await m.delete() os.remove(f)
async def take_ss(_, message: Message): if len(message.command) < 2: return await eor(message, text="Give A Url To Fetch Screenshot.") if len(message.command) == 2: url = message.text.split(None, 1)[1] full = False elif len(message.command) == 3: url = message.text.split(None, 2)[1] full = message.text.split(None, 2)[2].lower().strip() in [ "yes", "y", "1", "true", ] else: return await eor(message, text="Invalid Command.") m = await eor(message, text="Capturing screenshot...") try: photo = await take_screenshot(url, full) if not photo: return await m.edit("Failed To Take Screenshot") m = await m.edit("Uploading...") if not full: # Full size images have problem with reply_photo, that's why # we need to only use reply_photo if we're not using full size await gather( *[message.reply_document(photo), message.reply_photo(photo)] ) else: await message.reply_document(photo) await m.delete() except Exception as e: await m.edit(str(e))