From d1f509a00f8121cc25d29781895f384ca43aacb8 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Thu, 14 May 2020 23:04:08 +0200 Subject: [PATCH] add jssh_prinDB and BG send_action --- modules/jsonDB.sh | 8 +++++++- modules/sendMessage.sh | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/jsonDB.sh b/modules/jsonDB.sh index 76302c2..946eaf8 100644 --- a/modules/jsonDB.sh +++ b/modules/jsonDB.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.94-pre-7-g64efe96 +#### $$VERSION$$ v0.94-pre-8-g284172f # # source from commands.sh to use jsonDB functions # @@ -36,6 +36,12 @@ jssh_writeDB() { Array2Json "$1" >"${DB}" } +# print ARRAY content to stdout instead of file +# $1 ARRAY name, must be delared with "declare -A ARRAY" upfront +jssh_printDB() { + Array2Json "$1" +} + # update/write ARRAY content in file without deleting keys not in ARRAY # $1 ARRAY name, must be delared with "declare -A ARRAY" upfront # $2 filename (must exist!), must be relative to BASHBOT_ETC, and not contain '..' diff --git a/modules/sendMessage.sh b/modules/sendMessage.sh index 87ea7a0..90b6c80 100644 --- a/modules/sendMessage.sh +++ b/modules/sendMessage.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.94-pre-2-gc0a633f +#### $$VERSION$$ v0.94-pre-8-g284172f # source once magic, function named like file eval "$(basename "${BASH_SOURCE[0]}")(){ :; }" @@ -151,7 +151,7 @@ upload_file(){ # typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location send_action() { [ -z "$2" ] && return - sendJson "${1}" '"action": "'"${2}"'"' "$ACTION_URL" + sendJson "${1}" '"action": "'"${2}"'"' "$ACTION_URL" & } send_location() {