From c001d148f85f4c9414f943b6a776c062e58ec9e9 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Sun, 14 Apr 2019 23:04:17 +0200 Subject: [PATCH] adjust doc, fix unneeded JsonDecode use --- bashbot.sh | 4 ++-- doc/5_practice.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bashbot.sh b/bashbot.sh index a3e6dfe..42f13aa 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -10,7 +10,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.60-dev3-8-gdec3150 +#### $$VERSION$$ v0.60-dev3-9-g7e75b92 # # Exit Codes: # - 0 sucess (hopefully) @@ -528,7 +528,7 @@ process_client() { REPLYTO[UID]="$(JsonGetValue '"result",'$PROCESS_NUMBER',"message","reply_to_message","from","id"' <"$TMP" )" if [ "${REPLYTO[UID]}" != "" ]; then REPLYTO[0]="$(JsonDecode "$(JsonGetString '"result",'$PROCESS_NUMBER',"message","reply_to_message","text"' <"$TMP")")" - REPLYTO[ID]="$(JsonDecode "$(JsonGetValue '"result",'$PROCESS_NUMBER',"message","reply_to_message","message_id"' <"$TMP")")" + REPLYTO[ID]="$(JsonGetValue '"result",'$PROCESS_NUMBER',"message","reply_to_message","message_id"' <"$TMP")" REPLYTO[FIRST_NAME]="$(JsonDecode "$(JsonGetString '"result",'$PROCESS_NUMBER',"message","reply_to_message","from","first_name"' <"$TMP")")" REPLYTO[LAST_NAME]="$(JsonDecode "$(JsonGetString '"result",'$PROCESS_NUMBER',"message","reply_to_message","from","last_name"' <"$TMP")")" REPLYTO[USERNAME]="$(JsonDecode "$(JsonGetString '"result",'$PROCESS_NUMBER',"message","reply_to_message","from","username"' <"$TMP")")" diff --git a/doc/5_practice.md b/doc/5_practice.md index c06e91c..89bd3c4 100644 --- a/doc/5_practice.md +++ b/doc/5_practice.md @@ -111,5 +111,5 @@ In bashbot.sh line 490: ``` As you can see there are only two warnings in bashbots scripts. The first is a hint you may use shell substitions instead of sed, but this is only possible for simple cases. The second warning is about an unused variable, this is true because in our examples CONTACT is not used but assigned in case you want to use it :-) -#### $$VERSION$$ v0.60-dev3-7-gf5538ef +#### $$VERSION$$ v0.60-dev3-9-g7e75b92