Add reply in qr

This commit is contained in:
yasir 2023-02-14 12:21:56 +07:00
parent 38a32639b7
commit 8918bf19fd

View file

@ -69,9 +69,9 @@ async def readqr(c, m):
@app.on_message(filters.command("createqr", COMMAND_HANDLER))
async def makeqr(c, m):
if len(m.command) == 1:
if len(m.command) == 1 and not m.reply_to_message.text:
return await m.reply("Please add text after command to convert text -> QR Code.")
teks = m.text.split(None, 1)[1]
teks = m.text.split(None, 1)[1] or m.reply_to_message.text
url = f"https://api.qrserver.com/v1/create-qr-code/?data={quote(teks)}&size=300x300"
await m.reply_photo(url, caption=f"<b>QR Code Maker by @{c.me.username}</b>", quote=True)