mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-01-16 02:42:19 +00:00
fix misst quotaion mark in _formated_message_url
This commit is contained in:
parent
a25f876a06
commit
da7b1bccbf
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# this has to run once atfer git clone
|
# this has to run once atfer git clone
|
||||||
# and every time we create new hooks
|
# and every time we create new hooks
|
||||||
#### $$VERSION$$ v1.2-7-gd6e1c22
|
#### $$VERSION$$ v1.2-dev2-11-ga25f876
|
||||||
|
|
||||||
# magic to ensure that we're always inside the root of our application,
|
# magic to ensure that we're always inside the root of our application,
|
||||||
# no matter from which directory we'll run script
|
# no matter from which directory we'll run script
|
||||||
@ -19,7 +19,7 @@ cp -r ./* "${TESTENV}"
|
|||||||
cd "test" || exit 1
|
cd "test" || exit 1
|
||||||
|
|
||||||
# delete possible config
|
# delete possible config
|
||||||
rm "${TESTENV}/botconfig.jssh" "${TESTENV}/botacl"
|
rm -f "${TESTENV}/botconfig.jssh" "${TESTENV}/botacl" 2>/dev/null
|
||||||
|
|
||||||
#set -e
|
#set -e
|
||||||
fail=0
|
fail=0
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
#### $$VERSION$$ v1.2-dev2-10-g4f600e2
|
#### $$VERSION$$ v1.2-dev2-11-ga25f876
|
||||||
|
|
||||||
# will be automatically sourced from bashbot
|
# will be automatically sourced from bashbot
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ _formated_message_url(){
|
|||||||
text="${text//$'\n'/\\n}"
|
text="${text//$'\n'/\\n}"
|
||||||
[ "${#text}" -ge 4096 ] && log_error "Warning: html/markdown message longer than 4096 characters, message is rejected if formatting crosses 4096 border."
|
[ "${#text}" -ge 4096 ] && log_error "Warning: html/markdown message longer than 4096 characters, message is rejected if formatting crosses 4096 border."
|
||||||
until [ -z "${text}" ]; do
|
until [ -z "${text}" ]; do
|
||||||
sendJson "${1}" '"text":"'"${text:0:4096}"''"${3}"'' "${4}"
|
sendJson "${1}" '"text":"'"${text:0:4096}"'"'"${3}"'' "${4}"
|
||||||
text="${text:4096}"
|
text="${text:4096}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ _markdownv2_message_url() {
|
|||||||
# markdown v2 needs additional double escaping!
|
# markdown v2 needs additional double escaping!
|
||||||
text="$(sed -E -e 's|([#{}()!.-])|\\\1|g' <<< "$text")"
|
text="$(sed -E -e 's|([#{}()!.-])|\\\1|g' <<< "$text")"
|
||||||
until [ -z "${text}" ]; do
|
until [ -z "${text}" ]; do
|
||||||
sendJson "${1}" '"text":"'"${text:0:4096}"''"${3}"'' "${4}"
|
sendJson "${1}" '"text":"'"${text:0:4096}"'"'"${3}"'' "${4}"
|
||||||
text="${text:4096}"
|
text="${text:4096}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user