mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-01-15 18:36:48 +00:00
fix is_botadmin vs. is_admin, again
This commit is contained in:
parent
6c6b312f47
commit
1e0de91a2d
@ -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$$ v0.94-pre-2-gc0a633f
|
||||
#### $$VERSION$$ v0.94-pre-5-g6c6b312
|
||||
|
||||
# source once magic, function named like file
|
||||
eval "$(basename "${BASH_SOURCE[0]}")(){ :; }"
|
||||
@ -51,6 +51,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
|
||||
|
Loading…
Reference in New Issue
Block a user