diff --git a/misskaty/plugins/misc_tools.py b/misskaty/plugins/misc_tools.py index 685fe2bf..e91c46fa 100644 --- a/misskaty/plugins/misc_tools.py +++ b/misskaty/plugins/misc_tools.py @@ -69,9 +69,12 @@ async def readqr(c, m): @app.on_message(filters.command("createqr", COMMAND_HANDLER)) async def makeqr(c, m): - if len(m.command) == 1 and (m.reply_to_message and not m.reply_to_message.text): + if m.reply_to_message and m.reply_to_message.text: + teks = m.reply_to_message.text + elif len(m.command) > 1: + teks = m.text.split(None, 1)[1] + else: return await m.reply("Please add text after command to convert text -> QR Code.") - teks = m.text.split(None, 1)[1] if m.reply_to_message else 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"QR Code Maker by @{c.me.username}", quote=True)