Crazy-Marvin / QRTelegramBot

A bot for Telegram that can create and read QR codes

Home Page:https://t.me/QRCodeTelegramBot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve QR Code Recognition / Input Via Camera

CrazyMarvin opened this issue · comments

The bot does not recognize QR codes well at the moment.

Hi @CrazyMarvin,
Can you explain what you mean?

The users can send pictures with QR codes to the bot and it should reply with the content. Unfortunately that does not work often.
I attached two examples. One is a picture of a sticker and the other one is a graphic created by the bot itself.

22a160ad-c054-41b5-9bae-8f08f097e897

036533ca-b7f6-4b17-aedb-49c5eab2a102

One way to better read QR codes would be to use the camera from your smartphone or PC. Soham wants to use the new functionality Web Apps for Bots for this purpose, which currently still has a bug on the part of Telegram.

Which currently still has a bug on the part of Telegram.

I'll try to find a better QR Scanner package that can be implemented in JavaScript.

What do you think of using feature flags to test different packages and maybe to enable/disable the camera input for some users?

• Added a native QR scanner popup, controllable via showScanQrPopup (https://core.telegram.org/bots/webapps#initializing-web-apps) and closeScanQrPopup (https://core.telegram.org/bots/webapps#initializing-web-apps).

Maybe some new features in the Bot API 6.4 help us. 🤔

Forums
• Bots can now open (https://core.telegram.org/bots/api#reopengeneralforumtopic), close (https://core.telegram.org/bots/api#closegeneralforumtopic), edit (https://core.telegram.org/bots/api#editgeneralforumtopic) and toggle the visibility (https://core.telegram.org/bots/api#hidegeneralforumtopic) of the General Topic.
• Added support for new service messages, like ForumTopicEdited (https://core.telegram.org/bots/api#forumtopicedited), GeneralForumTopicHidden (https://core.telegram.org/bots/api#generalforumtopichidden) and more.
• The method sendChatAction (https://core.telegram.org/bots/api#sendchataction) can now send actions to any thread or topic via the message_thread_id parameter.

Spoilers
• Added spoiler detection via the new has_media_spoiler field in the Message (https://core.telegram.org/bots/api#message) class.
• Bots can send media covered by a spoiler animation via the has_spoiler field in sendPhoto (https://core.telegram.org/bots/api#sendphoto), sendVideo (https://core.telegram.org/bots/api#sendvideo) and sendAnimation (https://core.telegram.org/bots/api#sendanimation).

Web Apps
• Added a native QR scanner popup, controllable via showScanQrPopup (https://core.telegram.org/bots/webapps#initializing-web-apps) and closeScanQrPopup (https://core.telegram.org/bots/webapps#initializing-web-apps).
• Web Apps launched from the attachment menu can request clipboard text via readTextFromClipboard (https://core.telegram.org/bots/webapps#initializing-web-apps).
• Added a platform field, showing which platform the web app is being used on.

General
• Added the is_persistent field, to keep ReplyKeyboards (https://core.telegram.org/bots/api#replykeyboardmarkup) open by default.

• And more, see the full changelog for details:

https://core.telegram.org/bots/api-changelog#december-30-2022

Maybe some new features in the Bot API 6.4 help us. 🤔

Ah! This seems like a viable solution to our problem. I will try to see if works in our web application.

Implemented in v0.1.