Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloda image issue from LUA script #1718

Open
aswinlseven opened this issue Aug 18, 2021 · 5 comments
Open

downloda image issue from LUA script #1718

aswinlseven opened this issue Aug 18, 2021 · 5 comments

Comments

@aswinlseven
Copy link

I cannot download image from LUA script, it seem there is new API update from telegram, this issue happen this month for me August 2021. I used this image ( QR/Text ) download from telegram-cli and process the image with QRscan/Barcode scan and also read the text with tesseract for OCR. and sometimes use telegram-cli for insert my inventory device take a photo from telegram with caption and process by telegram-cli using LUA, why I still use telegram-cli it fastest then telegram bot.

@vysheng

1629263184.639254 error for query 'download part' #6997632093975428096: #400 FILEREF_UPGRADE_NEEDED
*** 1629263184.639317 lua: /root/.telegram-cli/server.lua:1101: bad argument #1 to 'sub' (string expected, got boolean)
*** 1629263184.645329 Notification API_ERROR_UPDATE_UNOFFICIAL_84: Error. Please update your app to the latest version or switch to the official version of Telegram.

thank you

@Paulchen232
Copy link

Tell me the lua script or function.

@aswinlseven
Copy link
Author

this is some example of mycode,
the image download issue this year, before that it all running good.
I saw ini here same issue kenorb-contrib#34

if msg.media then
if (msg.media.caption == nil ) then
if msg.media.type == "geo" or msg.media.type == "venue" then
--something function
else
--something function
end
elseif (msg.media.caption == #scan ) then
load_photo(msg.id, scan, msg.id)
end
end

function scan(extra,success,result)
if success then
-- get image filename
local img = string.sub(result,31)
-- processing image with linux cli
local process=os.capture('zbarimg -q ' .. img)
--send information from barcode after scan
send_msg(msg.from.print_name, process ,ok_cb,false)
else
print('Error downloading: '..extra)
end
end

@Paulchen232
Copy link

And witch line comes "lua: /root/.telegram-cli/server.lua:1101: bad argument #1 to 'sub' (string expected, got boolean)"

@aswinlseven

This comment has been minimized.

@aswinlseven
Copy link
Author

aswinlseven commented Aug 20, 2021

I just produce new error like this

[0%Down]> load_photo 18
*** 1629439943.987499 error for query 'download part' #6998391267747319808: #400 FILEREF_UPGRADE_NEEDED
FAIL: 71: RPC_CALL_FAIL 400: FILEREF_UPGRADE_NEEDED
*** 1629439943.989467 Notification API_ERROR_UPDATE_UNOFFICIAL_143: Error. Please update your app to the latest version or switch to the official version of Telegram.
[0%Down]>

so it mean load_photo() function not working anymore

just ignore this error "lua: /root/.telegram-cli/server.lua:1101: bad argument #1 to 'sub' (string expected, got boolean)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants