mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-25 08:47:34 +00:00
modules: fix new_chat_invite
This commit is contained in:
parent
29fa5cfcca
commit
8ae30faffc
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user