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:
Kay Marquardt 2020-05-14 12:10:37 +02:00 committed by GitHub
parent fa1afc4aa9
commit eef955abf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,7 @@ user_is_admin() {
user_is_botadmin() {
local admin; admin="$(head -n 1 "${BOTADMIN}")"
[ "${admin}" = "${1}" ] && return 0
[ "${admin}" = "${2}" ] && return 0
[[ "${admin}" = "@*" ]] && [[ "${admin}" = "${2}" ]] && return 0
if [ "${admin}" = "?" ]; then printf '%s\n' "${1:-?}" >"${BOTADMIN}"; return 0; fi
return 1