minor optimisation to URLS processing

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2020-06-29 12:25:55 +02:00
parent 928dfa27be
commit 12b4696e80

View File

@ -11,7 +11,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.962-109-g517e600 #### $$VERSION$$ v0.962-110-g4883c18
# #
# Exit Codes: # Exit Codes:
# - 0 success (hopefully) # - 0 success (hopefully)
@ -810,7 +810,7 @@ process_message() {
fi fi
# get file URL from telegram # get file URL from telegram
if grep -qs -e '\["result",'"${num}"',"message",".*,"file_id"\]' <<<"${UPDATE}"; then if grep -qs -e '\["result",'"${num}"',"message","[avpsd].*,"file_id"\]' <<<"${UPDATE}"; then
URLS[AUDIO]="$(get_file "${UPD["result",${num},"message","audio","file_id"]}")" URLS[AUDIO]="$(get_file "${UPD["result",${num},"message","audio","file_id"]}")"
URLS[DOCUMENT]="$(get_file "${UPD["result",${num},"message","document","file_id"]}")" URLS[DOCUMENT]="$(get_file "${UPD["result",${num},"message","document","file_id"]}")"
URLS[PHOTO]="$(get_file "${UPD["result",${num},"message","photo",0,"file_id"]}")" URLS[PHOTO]="$(get_file "${UPD["result",${num},"message","photo",0,"file_id"]}")"