mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-01-01 06:11:46 +00:00
is_botadmin compatibility when changed from is_admin
if is_admin is changed to is_botadmin and vice versa, the first argument stays with chatid ...
This commit is contained in:
parent
fa1afc4aa9
commit
eef955abf3
@ -48,6 +48,7 @@ user_is_admin() {
|
|||||||
user_is_botadmin() {
|
user_is_botadmin() {
|
||||||
local admin; admin="$(head -n 1 "${BOTADMIN}")"
|
local admin; admin="$(head -n 1 "${BOTADMIN}")"
|
||||||
[ "${admin}" = "${1}" ] && return 0
|
[ "${admin}" = "${1}" ] && return 0
|
||||||
|
[ "${admin}" = "${2}" ] && return 0
|
||||||
[[ "${admin}" = "@*" ]] && [[ "${admin}" = "${2}" ]] && return 0
|
[[ "${admin}" = "@*" ]] && [[ "${admin}" = "${2}" ]] && return 0
|
||||||
if [ "${admin}" = "?" ]; then printf '%s\n' "${1:-?}" >"${BOTADMIN}"; return 0; fi
|
if [ "${admin}" = "?" ]; then printf '%s\n' "${1:-?}" >"${BOTADMIN}"; return 0; fi
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user