mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-29 05:02:46 +00:00
more save split to array
This commit is contained in:
parent
4fe969766b
commit
80a6dbbe9f
11
bashbot.sh
11
bashbot.sh
@ -11,7 +11,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.98-dev-66-gd52ea8c
|
#### $$VERSION$$ v0.98-dev-67-g4fe9697
|
||||||
#
|
#
|
||||||
# Exit Codes:
|
# Exit Codes:
|
||||||
# - 0 sucess (hopefully)
|
# - 0 sucess (hopefully)
|
||||||
@ -839,14 +839,7 @@ process_message() {
|
|||||||
[[ "${SERVICE[*]}" =~ ^[[:blank:]]*$ ]] || SERVICE[0]="yes"
|
[[ "${SERVICE[*]}" =~ ^[[:blank:]]*$ ]] || SERVICE[0]="yes"
|
||||||
|
|
||||||
# split message in command and args
|
# split message in command and args
|
||||||
CMD=( )
|
[ "${MESSAGE[0]:0:1}" = "/" ] && read -r CMD <<<"${MESSAGE[0]}" && CMD[0]="${CMD[0]%%@*}"
|
||||||
if [[ "${MESSAGE[0]}" == "/"* ]]; then
|
|
||||||
set -f; unset IFS
|
|
||||||
# shellcheck disable=SC2206
|
|
||||||
CMD=( ${MESSAGE[0]} )
|
|
||||||
CMD[0]="${CMD[0]%%@*}"
|
|
||||||
set +f
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# This file is public domain in the USA and all free countries.
|
# This file is public domain in the USA and all free countries.
|
||||||
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
|
||||||
#
|
#
|
||||||
#### $$VERSION$$ v0.98-dev-66-gd52ea8c
|
#### $$VERSION$$ v0.98-dev-67-g4fe9697
|
||||||
|
|
||||||
# will be automatically sourced from bashbot
|
# will be automatically sourced from bashbot
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user