+ exporting photo data

This commit is contained in:
Dominika Liberda 2021-09-03 22:23:26 +02:00
parent b87b4cfe3a
commit a26a0d480f

16
tg.sh
View file

@ -123,7 +123,7 @@ function tg_start() {
(if .chat.type == "private" then .chat.username else .chat.title end),
.chat.type,
.date,
.text,
(select(.text) | .text, select(.caption) | .caption),
(if .reply_to_message then
.reply_to_message | (
"true",
@ -208,11 +208,23 @@ function tg_start() {
event[document_file_id]="${_tmp[2]}"
event[document_file_unique_id]="${_tmp[3]}"
event[document_file_size]="${_tmp[4]}"
unset _tmp
_on_document
elif [[ "$_event_type" == photo ]]; then
_jq_to_array '(select(.message) | .message), (select(.edited_message) | .edited_message) | .photo[-1] |
[.file_id,
.file_unique_id,
.file_size,
.width,
.height] | @sh' <<< "${_events[$i]}" # stub - add more things to me!
event[photo_file_id]="${_tmp[0]}"
event[photo_file_unique_id]="${_tmp[1]}"
event[photo_file_size]="${_tmp[2]}"
event[photo_height]="${_tmp[3]}"
event[photo_width]="${_tmp[4]}"
unset _tmp
_on_photo
elif [[ "$_event_type" == sticker ]]; then
_on_sticker