From 8ae30faffc498c6942010a28bdb3973a1123cf09 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Thu, 14 Jan 2021 22:56:43 +0100 Subject: [PATCH] modules: fix new_chat_invite --- bashbot.sh | 4 +++- modules/chatMember.sh | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index cd1bfed..67aebe6 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-12-g0739a51 +#### $$VERSION$$ v1.30-dev-13-g29fa5cf ################################################################## # emmbeded system may claim bash but it is not @@ -558,7 +558,9 @@ sendJsonResult(){ [ -n "${BASHBOTDEBUG}" ] && log_message "New Result ==========\n$1" BOTSENT[OK]="$(JsonGetLine '"ok"' <<< "$1")" if [ "${BOTSENT[OK]}" = "true" ]; then + BOTSENT[RESULT]="$(JsonGetString '"result"' <<< "$1")" BOTSENT[ID]="$(JsonGetValue '"result","message_id"' <<< "$1")" + BOTSENT[CHAT]="$(JsonGetValue '"result","chat","id"' <<< "$1")" return # hot path everything OK! else diff --git a/modules/chatMember.sh b/modules/chatMember.sh index 3c37035..7999a98 100644 --- a/modules/chatMember.sh +++ b/modules/chatMember.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$$ v1.30-dev-11-gab71f37 +#### $$VERSION$$ v1.30-dev-13-g29fa5cf # will be automatically sourced from bashbot @@ -17,6 +17,7 @@ eval "$(basename "${BASH_SOURCE[0]}")(){ :; }" # $1 chat new_chat_invite() { sendJson "$1" "" "${URL}/exportChatInviteLink" + [ "${BOTSENT[OK]}" = "true" ] && printf "%s\n" "${BOTSENT[RESULT]}" } # $1 chat, $2 title @@ -46,7 +47,7 @@ unpin_chat_message() { # $1 chat unpinall_chat_message() { - sendJson "$1" "" "${URL}/unpinAllChatMessage" + sendJson "$1" "" "${URL}/unpinAllChatMessages" } # $1 chat