diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2026-02-15 13:14:03 +0300 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2026-02-15 13:14:03 +0300 |
| commit | 504b9fca44b0b23ae5256482cefaea476d3ea290 (patch) | |
| tree | b31459ee7d40cbb0db96a847e217b6438c959948 | |
| parent | b09241a7f2cf9443a8376a400c9bcc3dc36402e3 (diff) | |
*/*: Remove extra exit code
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
| -rw-r--r-- | handlers/callback.zsh | 8 | ||||
| -rw-r--r-- | handlers/commands.zsh | 6 | ||||
| -rw-r--r-- | handlers/inline.zsh | 6 | ||||
| -rw-r--r-- | handlers/source.zsh | 12 | ||||
| -rw-r--r-- | handlers/timer.zsh | 4 | ||||
| -rw-r--r-- | operators/command_export.zsh | 2 | ||||
| -rw-r--r-- | operators/command_original.zsh | 2 | ||||
| -rw-r--r-- | operators/command_ping.zsh | 6 | ||||
| -rw-r--r-- | operators/command_source.zsh | 2 | ||||
| -rw-r--r-- | operators/url_parser.zsh | 4 | ||||
| -rw-r--r-- | units/ib_hash.zsh | 4 | ||||
| -rw-r--r-- | units/user.zsh | 4 |
12 files changed, 30 insertions, 30 deletions
diff --git a/handlers/callback.zsh b/handlers/callback.zsh index dd9dbf6..13410d7 100644 --- a/handlers/callback.zsh +++ b/handlers/callback.zsh @@ -6,7 +6,7 @@ callback_query=($(jq -r '.callback_query.data' <<< "${update}")) if [[ "${callback_query}" == "null" ]] then - exit 0 + exit fi user_id="$(jq -r '.callback_query.from.id' <<< "${update}")" @@ -53,7 +53,7 @@ case "${command}" in source "${operators}/callback_tags.zsh" ;; (*) - exit 0 + exit ;; esac @@ -128,7 +128,7 @@ then log_text="answerCallbackQuery (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - exit 0 + exit fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -136,7 +136,7 @@ then log_text="answerCallbackQuery (${update_id}): An unknown error occurred" source "${units}/log.zsh" - exit 0 + exit fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] diff --git a/handlers/commands.zsh b/handlers/commands.zsh index e72a54c..2e99141 100644 --- a/handlers/commands.zsh +++ b/handlers/commands.zsh @@ -6,7 +6,7 @@ command_query=($(jq -r '.message.text' <<< "${update}")) if [[ "${command_query}" == "null" ]] then - exit 0 + exit fi user_id="$(jq -r '.message.from.id' <<< "${update}")" @@ -100,7 +100,7 @@ then log_text="sendMessage (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - exit 0 + exit fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -108,7 +108,7 @@ then log_text="sendMessage (${update_id}): An unknown error occurred" source "${units}/log.zsh" - exit 0 + exit fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] diff --git a/handlers/inline.zsh b/handlers/inline.zsh index 2bb16e1..8fa0552 100644 --- a/handlers/inline.zsh +++ b/handlers/inline.zsh @@ -6,7 +6,7 @@ inline_query=($(jq -r '.inline_query.query' <<< "${update}")) if [[ "${inline_query}" == "null" ]] then - exit 0 + exit fi user_id="$(jq -r '.inline_query.from.id' <<< "${update}")" @@ -67,7 +67,7 @@ then log_text="answerInlineQuery (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - exit 0 + exit fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -75,7 +75,7 @@ then log_text="answerInlineQuery (${update_id}): An unknown error occurred" source "${units}/log.zsh" - exit 0 + exit fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] diff --git a/handlers/source.zsh b/handlers/source.zsh index d3a0204..5a473f3 100644 --- a/handlers/source.zsh +++ b/handlers/source.zsh @@ -4,7 +4,7 @@ if [[ -n "${nocommand_source}" ]] then - exit 0 + exit fi user_id="$(jq -r '.message.from.id' <<< "${update}")" @@ -12,21 +12,21 @@ chat_id="$(jq -r '.message.chat.id' <<< "${update}")" if [[ "${chat_id}" != "${user_id}" ]] then - exit 0 + exit fi file_id="$(jq -r '.message.photo.[1].file_id' <<< "${update}")" if [[ "${file_id}" == "null" ]] then - exit 0 + exit fi via_bot="$(jq -r '.message.via_bot.username' <<< "${update}")" if [[ "${via_bot}" == "${username}" ]] then - exit 0 + exit fi message_id="$(jq -r '.message.message_id' <<< "${update}")" @@ -70,7 +70,7 @@ then log_text="sendMessage (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - exit 0 + exit fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -78,7 +78,7 @@ then log_text="sendMessage (${update_id}): An unknown error occurred" source "${units}/log.zsh" - exit 0 + exit fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] diff --git a/handlers/timer.zsh b/handlers/timer.zsh index 269ac5a..483863a 100644 --- a/handlers/timer.zsh +++ b/handlers/timer.zsh @@ -4,7 +4,7 @@ if ! mkdir "${cache}.lock" then - exit 0 + exit fi timer_ctime=$(strftime %s) @@ -13,7 +13,7 @@ timer_mtime=$(< "${cache}.timer") if [[ $((timer_ctime - timer_mtime)) -lt 5 ]] then rmdir "${cache}.lock" - exit 0 + exit fi source "${operators}/timer_unlock.zsh" diff --git a/operators/command_export.zsh b/operators/command_export.zsh index fe68802..370aea0 100644 --- a/operators/command_export.zsh +++ b/operators/command_export.zsh @@ -25,5 +25,5 @@ done if [[ -z "${output_text}" ]] then - exit 0 + exit fi diff --git a/operators/command_original.zsh b/operators/command_original.zsh index adeebdf..19fdc44 100644 --- a/operators/command_original.zsh +++ b/operators/command_original.zsh @@ -151,4 +151,4 @@ then fi rmdir "${cache}/${ib_hash}.lock" -exit 0 +exit diff --git a/operators/command_ping.zsh b/operators/command_ping.zsh index dfb6016..bd45bab 100644 --- a/operators/command_ping.zsh +++ b/operators/command_ping.zsh @@ -83,7 +83,7 @@ then log_text="editMessageText (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - exit 0 + exit fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -91,7 +91,7 @@ then log_text="editMessageText (${update_id}): An unknown error occurred" source "${units}/log.zsh" - exit 0 + exit fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] @@ -108,4 +108,4 @@ then source "${units}/log.zsh" fi -exit 0 +exit diff --git a/operators/command_source.zsh b/operators/command_source.zsh index 9553bc6..8a3f9f8 100644 --- a/operators/command_source.zsh +++ b/operators/command_source.zsh @@ -4,7 +4,7 @@ if [[ -n "${nocommand_source}" ]] then - exit 0 + exit fi until mkdir "${user_config}_source.lock" diff --git a/operators/url_parser.zsh b/operators/url_parser.zsh index b24c1bf..cfe874c 100644 --- a/operators/url_parser.zsh +++ b/operators/url_parser.zsh @@ -44,7 +44,7 @@ done if [[ -z "${ib_post_id}" ]] then - exit 0 + exit fi source "${units}/ib_config.zsh" @@ -52,7 +52,7 @@ source "${units}/ib_authconfig.zsh" if [[ ${#ib_post_id} -gt 32 ]] then - exit 0 + exit elif [[ ${#ib_post_id} -eq 32 ]] then ib_query="md5:${ib_post_id}" diff --git a/units/ib_hash.zsh b/units/ib_hash.zsh index 4c1ccd9..e75c95d 100644 --- a/units/ib_hash.zsh +++ b/units/ib_hash.zsh @@ -10,7 +10,7 @@ source "${units}/ib_authconfig.zsh" if [[ -z "${ib_data_url}" ]] then - exit 0 + exit fi ib_query="md5:${ib_post_md5}" @@ -28,7 +28,7 @@ source "${units}/ib_file.zsh" if [[ -n "${output_text}" ]] then rmdir "${cache}/${ib_hash}.lock" - exit 0 + exit fi if [[ -z "${output_text}" ]] diff --git a/units/user.zsh b/units/user.zsh index 9ae4aec..bbd82a4 100644 --- a/units/user.zsh +++ b/units/user.zsh @@ -15,12 +15,12 @@ fi if [[ -s "${blacklist_list}" ]] && grep -qx "${user_id}" "${blacklist_list}" then - exit 0 + exit fi if [[ -s "${whitelist_list}" ]] && ! grep -qx "${user_id}" "${whitelist_list}" then - exit 0 + exit fi user_config="${users}/${user_id}" |
