From 71daed3487ddff953a319f30c72a7cff73ef9950 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Thu, 14 Jan 2021 18:31:39 +0100 Subject: [PATCH] modules: sendMessage: fix curl detection --- bashbot.sh | 2 +- modules/sendMessage.sh | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index e8e841f..32da63f 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb # 8 - curl/wget missing # 10 - not bash! # -#### $$VERSION$$ v1.30-dev-4-gf573d63 +#### $$VERSION$$ v1.30-dev-6-g87f618f ################################################################## # emmbeded system may claim bash but it is not diff --git a/modules/sendMessage.sh b/modules/sendMessage.sh index feb5e55..ec02694 100644 --- a/modules/sendMessage.sh +++ b/modules/sendMessage.sh @@ -6,7 +6,7 @@ # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # # shellcheck disable=SC1117 -#### $$VERSION$$ v1.30-dev-5-gdaeffb3 +#### $$VERSION$$ v1.30-dev-6-g87f618f # will be automatically sourced from bashbot @@ -149,9 +149,10 @@ send_sticker() { } -if [ -z "${BASHBOT_WGET}" ] && _exists curl ; then -# there are no checks if URL or ID exists -# $1 chat $3 ... $n URL or ID +# only curl can send files ... +if detect_curl ; then + # there are no checks if URL or ID exists + # $1 chat $3 ... $n URL or ID send_album(){ [ -z "$1" ] && return 1 [ -z "$3" ] && return 2 # minimum 2 files @@ -169,7 +170,7 @@ if [ -z "${BASHBOT_WGET}" ] && _exists curl ; then } else send_album(){ - log_error "Sorry, wget Album upload not yet implemented" + log_error "Sorry, wget Album upload not implemented" BOTSENT[OK]="false" [[ -z "${SOURCE}" && -n "${BASHBOT_EVENT_SEND[*]}" ]] && event_send "album" "$@" & }