diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-12-30 14:01:06 +0300 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-12-30 14:01:06 +0300 |
| commit | 420216f69204a6720816ef03cfc73c1fce5a8cf9 (patch) | |
| tree | 03f52dadcd55ece920104f87fcad7d09c4066454 | |
| parent | 7f5c0175e973f2f2795239382446197ebf026515 (diff) | |
*/*: Remove unused return code
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
40 files changed, 99 insertions, 99 deletions
diff --git a/auth/donmai.zsh b/auth/donmai.zsh index d7e3eab..ae18fb7 100644 --- a/auth/donmai.zsh +++ b/auth/donmai.zsh @@ -21,7 +21,7 @@ then log_text="ib_auth (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi if ! jq -e '.' <<< "${ib_auth_data}" > /dev/null @@ -31,19 +31,19 @@ then log_text="ib_auth (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi if [[ "$(jq -r '.success' <<< "${ib_auth_data}")" == "false" ]] then output_text="Error: <code>$(jq -r '.message' <<< "${ib_auth_data}" | htmlescape)</code>" - return 0 + return fi if [[ "$(jq -r '.name' <<< "${ib_auth_data}")" != "${ib_login}" ]] then output_text="Failed to verify user authorization" - return 0 + return fi printf "%s" "${ib_login}:${ib_key}" | base64 > "${token_file}" diff --git a/auth/moebooru.zsh b/auth/moebooru.zsh index 747250d..459cdc9 100644 --- a/auth/moebooru.zsh +++ b/auth/moebooru.zsh @@ -22,7 +22,7 @@ then log_text="ib_auth (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi if ! jq -e '.' <<< "${ib_auth_data}" > /dev/null diff --git a/auth/sankakucomplex.zsh b/auth/sankakucomplex.zsh index ebd71f0..d7f1791 100644 --- a/auth/sankakucomplex.zsh +++ b/auth/sankakucomplex.zsh @@ -29,7 +29,7 @@ then log_text="ib_auth (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi if ! jq -e '.' <<< "${ib_auth_data}" > /dev/null @@ -39,13 +39,13 @@ then log_text="ib_auth (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi if [[ "$(jq -r '.success' <<< "${ib_auth_data}")" != "true" ]] then output_text="Error: <code>$(jq -r '.error' <<< "${ib_auth_data}" | htmlescape)</code>" - return 0 + return fi jq -r '.access_token' <<< "${ib_auth_data}" > "${token_file}" diff --git a/submodules/callback_delete.zsh b/submodules/callback_delete.zsh index d786ec1..a2334bf 100644 --- a/submodules/callback_delete.zsh +++ b/submodules/callback_delete.zsh @@ -25,7 +25,7 @@ then log_text="deleteMessage (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - return 0 + return fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -35,7 +35,7 @@ then log_text="deleteMessage (${update_id}): An unknown error occurred" source "${units}/log.zsh" - return 0 + return fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] diff --git a/submodules/callback_post.zsh b/submodules/callback_post.zsh index 66df417..301001f 100644 --- a/submodules/callback_post.zsh +++ b/submodules/callback_post.zsh @@ -7,7 +7,7 @@ source "${units}/ib_common.zsh" if [[ -n "${notification_text}" ]] then - return 0 + return fi ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)" @@ -23,7 +23,7 @@ source "${units}/ib_file.zsh" if [[ -n "${notification_text}" ]] then rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi source "${units}/ib_post.zsh" diff --git a/submodules/callback_short.zsh b/submodules/callback_short.zsh index 1316e4e..a48a27c 100644 --- a/submodules/callback_short.zsh +++ b/submodules/callback_short.zsh @@ -15,7 +15,7 @@ else notification_text="You must specify query" rmdir "${user_config}_shorts.lock" - return 0 + return fi shorts_config="${user_config}/shorts" @@ -25,7 +25,7 @@ then notification_text="Failed to create user config" rmdir "${user_config}_shorts.lock" - return 0 + return fi short_hash="$(sha1sum <<< "${short_query}" | cut -d ' ' -f 1)" diff --git a/submodules/callback_stop.zsh b/submodules/callback_stop.zsh index 739ca60..d2eab2c 100644 --- a/submodules/callback_stop.zsh +++ b/submodules/callback_stop.zsh @@ -17,7 +17,7 @@ do elif [[ "${check_table[1]}" == "${check_table[-2]}" ]] then notification_text="No requested data found" - return 0 + return fi shift 2 check_table @@ -26,7 +26,7 @@ done if mkdir "${user_config}_stop.lock" then notification_text="Click again to confirm data removal" - return 0 + return fi for lock in ${user_locks[@]} diff --git a/submodules/callback_tags.zsh b/submodules/callback_tags.zsh index 6f83c9e..1198a5e 100644 --- a/submodules/callback_tags.zsh +++ b/submodules/callback_tags.zsh @@ -7,7 +7,7 @@ source "${units}/ib_common.zsh" if [[ -n "${notification_text}" ]] then - return 0 + return fi ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)" @@ -23,7 +23,7 @@ source "${units}/ib_file.zsh" if [[ -n "${notification_text}" ]] then rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi ib_file_size="$(jq -r ".${ib_iarray}[0].${ib_isize}" "${ib_file}")" @@ -44,7 +44,7 @@ then notification_text="Failed to get tags" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi while [[ ${#ib_groups} -ge 2 ]] @@ -94,7 +94,7 @@ then notification_text="No tags found" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi link_preview_options="$( diff --git a/submodules/command_authorize.zsh b/submodules/command_authorize.zsh index bbb2a3b..a8be540 100644 --- a/submodules/command_authorize.zsh +++ b/submodules/command_authorize.zsh @@ -11,13 +11,13 @@ then if [[ -z "${ib_auth}" ]] then output_text="Unsupported Image Board" - return 0 + return fi shift else output_text="You must specify Image Board" - return 0 + return fi if [[ -n "${1}" ]] diff --git a/submodules/command_export.zsh b/submodules/command_export.zsh index cbffb4d..fe68802 100644 --- a/submodules/command_export.zsh +++ b/submodules/command_export.zsh @@ -5,7 +5,7 @@ if [[ "${chat_id}" != "${target_user}" ]] then output_text="For security reasons you can execute this command only in direct messages" - return 0 + return fi for lock in ${user_locks[@]} diff --git a/submodules/command_hash.zsh b/submodules/command_hash.zsh index 1c4fb92..d8bb677 100644 --- a/submodules/command_hash.zsh +++ b/submodules/command_hash.zsh @@ -8,13 +8,13 @@ then shift else output_text="You must specify MD5 hash" - return 0 + return fi if ! [[ ${#ib_post_md5} -eq 32 ]] then output_text="Invalid MD5 hash" - return 0 + return fi ib_post="${cache}/${update_id}_id.txt" diff --git a/submodules/command_original.zsh b/submodules/command_original.zsh index 0164f4c..adeebdf 100644 --- a/submodules/command_original.zsh +++ b/submodules/command_original.zsh @@ -6,14 +6,14 @@ source "${units}/ib_name.zsh" if [[ -n "${output_text}" ]] then - return 0 + return fi source "${units}/ib_common.zsh" if [[ -n "${output_text}" ]] then - return 0 + return fi ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)" @@ -29,7 +29,7 @@ source "${units}/ib_file.zsh" if [[ -n "${output_text}" ]] then rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi source "${units}/ib_original.zsh" @@ -50,7 +50,7 @@ fi if [[ -n "${output_text}" ]] then rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi if ! output_data="$( @@ -118,7 +118,7 @@ then source "${units}/log.zsh" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -129,7 +129,7 @@ then source "${units}/log.zsh" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] @@ -147,7 +147,7 @@ then source "${units}/log.zsh" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi rmdir "${cache}/${ib_hash}.lock" diff --git a/submodules/command_ping.zsh b/submodules/command_ping.zsh index 5969edd..83ffb3b 100644 --- a/submodules/command_ping.zsh +++ b/submodules/command_ping.zsh @@ -27,7 +27,7 @@ then log_text="sendMessage (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - return 0 + return fi latency_fin=$(strftime %s%N) @@ -39,7 +39,7 @@ then log_text="sendMessage (${update_id}): An unknown error occurred" source "${units}/log.zsh" - return 0 + return fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] @@ -55,7 +55,7 @@ then fi source "${units}/log.zsh" - return 0 + return fi chat_id="$(jq -r '.result.chat.id' <<< "${output_data}")" diff --git a/submodules/command_post.zsh b/submodules/command_post.zsh index 08ace0a..2ead112 100644 --- a/submodules/command_post.zsh +++ b/submodules/command_post.zsh @@ -6,14 +6,14 @@ source "${units}/ib_name.zsh" if [[ -n "${output_text}" ]] then - return 0 + return fi source "${units}/ib_common.zsh" if [[ -n "${output_text}" ]] then - return 0 + return fi ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)" @@ -29,7 +29,7 @@ source "${units}/ib_file.zsh" if [[ -n "${output_text}" ]] then rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi source "${units}/ib_post.zsh" diff --git a/submodules/command_short.zsh b/submodules/command_short.zsh index bed1553..cc551e3 100644 --- a/submodules/command_short.zsh +++ b/submodules/command_short.zsh @@ -8,13 +8,13 @@ then shift ${#} else output_text="You must specify query" - return 0 + return fi if [[ ${#short_query} -gt 256 ]] then output_text="Query is too long" - return 0 + return fi output_text="<b>Shortcut:</b> <code>$(htmlescape <<< "${short_query}")</code>" diff --git a/submodules/command_shorts.zsh b/submodules/command_shorts.zsh index 1a32106..f52b531 100644 --- a/submodules/command_shorts.zsh +++ b/submodules/command_shorts.zsh @@ -19,7 +19,7 @@ then output_text="You have no saved shortcuts yet" rmdir "${user_config}_shorts.lock" - return 0 + return fi output_text="<b>Saved shortcuts:</b> ${#shorts} / ${shorts_limit}" diff --git a/submodules/command_source.zsh b/submodules/command_source.zsh index 6c306c3..9553bc6 100644 --- a/submodules/command_source.zsh +++ b/submodules/command_source.zsh @@ -18,14 +18,14 @@ rmdir "${user_config}_source.lock" if [[ -n "${output_text}" ]] then - return 0 + return fi source "${units}/sn_get.zsh" if [[ -n "${output_text}" ]] then - return 0 + return fi source_table=( @@ -58,7 +58,7 @@ done if [[ ${highest_similarity} -lt ${minimum_similarity} || ${highest_similarity} -lt 70.00 ]] then output_text="No results found" - return 0 + return fi thumbnail="$(jq -r ".results.[${highest_index}].header.thumbnail" <<< "${sn_data}")" diff --git a/submodules/command_stop.zsh b/submodules/command_stop.zsh index a14a723..1ddf10c 100644 --- a/submodules/command_stop.zsh +++ b/submodules/command_stop.zsh @@ -5,7 +5,7 @@ if [[ "${chat_id}" != "${target_user}" ]] then output_text="For security reasons you can execute this command only in direct messages" - return 0 + return fi for lock in ${user_locks[@]} diff --git a/submodules/inline_donate.zsh b/submodules/inline_donate.zsh index 72b6bf8..a0257ca 100644 --- a/submodules/inline_donate.zsh +++ b/submodules/inline_donate.zsh @@ -5,7 +5,7 @@ if [[ -n "${nocommand_donate}" ]] then source "${submods}/inline_help.zsh" - return 0 + return fi output_title="Donate" diff --git a/submodules/inline_original.zsh b/submodules/inline_original.zsh index fb477ca..5e9caac 100644 --- a/submodules/inline_original.zsh +++ b/submodules/inline_original.zsh @@ -16,7 +16,7 @@ then '[{"type": "article", "id": $id, "title": $title, "input_message_content": {"message_text": $text}, "description": $description}]' )" - return 0 + return fi ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)" @@ -41,7 +41,7 @@ then )" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi source "${units}/ib_original.zsh" diff --git a/submodules/inline_post.zsh b/submodules/inline_post.zsh index 7dea5c7..92d7199 100644 --- a/submodules/inline_post.zsh +++ b/submodules/inline_post.zsh @@ -16,7 +16,7 @@ then '[{"type": "article", "id": $id, "title": $title, "input_message_content": {"message_text": $text}, "description": $description}]' )" - return 0 + return fi ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)" @@ -41,7 +41,7 @@ then )" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi source "${units}/ib_post.zsh" diff --git a/submodules/inline_search.zsh b/submodules/inline_search.zsh index 74efcd5..c3f1061 100644 --- a/submodules/inline_search.zsh +++ b/submodules/inline_search.zsh @@ -28,7 +28,7 @@ case "${command}" in ;; esac - return 0 + return ;; esac @@ -56,7 +56,7 @@ then '[{"type": "article", "id": $id, "title": $title, "input_message_content": {"message_text": $text}, "reply_markup": {"inline_keyboard": [[{"text": $text1, "switch_inline_query_current_chat": $query1}]]}, "description": $description}]' )" - return 0 + return fi ib_hash="$(sha1sum <<< "${user_id}${ib_mode}${ib_board}${ib_page}${ib_query}" | cut -d ' ' -f 1)" @@ -91,7 +91,7 @@ then )" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi ib_ids=("${(@f)$(jq -r ".${ib_iarray}[].${ib_iid}" "${ib_file}")}") diff --git a/submodules/inline_short.zsh b/submodules/inline_short.zsh index d33919e..84dd3d4 100644 --- a/submodules/inline_short.zsh +++ b/submodules/inline_short.zsh @@ -19,7 +19,7 @@ else '[{"type": "article", "id": $id, "title": $title, "input_message_content": {"message_text": $text}, "description": $description}]' )" - return 0 + return fi output_title="Shortcut" diff --git a/submodules/inline_shorts.zsh b/submodules/inline_shorts.zsh index ae0a090..ea40e95 100644 --- a/submodules/inline_shorts.zsh +++ b/submodules/inline_shorts.zsh @@ -41,7 +41,7 @@ then fi rmdir "${user_config}_shorts.lock" - return 0 + return fi for ((idx = 1; idx <= ${inline_limit} && idx <= ${#shorts}; idx++)) diff --git a/submodules/timer_uncache.zsh b/submodules/timer_uncache.zsh index f36ef2b..bbccd1d 100644 --- a/submodules/timer_uncache.zsh +++ b/submodules/timer_uncache.zsh @@ -4,7 +4,7 @@ if [[ -n "${no_clear}" ]] then - return 0 + return fi for file in $(find "${cache}" -follow -type f) diff --git a/submodules/url_parser.zsh b/submodules/url_parser.zsh index f68494d..b24c1bf 100644 --- a/submodules/url_parser.zsh +++ b/submodules/url_parser.zsh @@ -83,7 +83,7 @@ then )" rmdir "${cache}/${ib_hash}.lock" - return 0 + return fi source "${units}/ib_post.zsh" diff --git a/units/export.zsh b/units/export.zsh index 7680470..e92f612 100644 --- a/units/export.zsh +++ b/units/export.zsh @@ -5,7 +5,7 @@ if ! [[ -d "${user_config}" ]] then output_text="No user data found" - return 0 + return fi until mkdir "${cache}/${user_id}.lock" @@ -20,7 +20,7 @@ then output_text="Something went wrong, try again later" rmdir "${cache}/${user_id}.lock" - return 0 + return fi if ! output_data="$( @@ -84,7 +84,7 @@ then source "${units}/log.zsh" rmdir "${cache}/${user_id}.lock" - return 0 + return fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -95,7 +95,7 @@ then source "${units}/log.zsh" rmdir "${cache}/${user_id}.lock" - return 0 + return fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] diff --git a/units/ib_auth.zsh b/units/ib_auth.zsh index 7e713d6..db65754 100644 --- a/units/ib_auth.zsh +++ b/units/ib_auth.zsh @@ -9,7 +9,7 @@ then ib_login="$(< "${login_file}")" else output_text="You must specify ${ib_login_word} and ${ib_key_word}" - return 0 + return fi fi @@ -20,14 +20,14 @@ then ib_key="$(< "${key_file}")" else output_text="You must specify ${ib_key_word}" - return 0 + return fi fi if ! mkdir -p "${auth_dir}" then output_text="Failed to create user config" - return 0 + return fi case "${ib_board}" in diff --git a/units/ib_common.zsh b/units/ib_common.zsh index 7bcbe7b..5c0b9a3 100644 --- a/units/ib_common.zsh +++ b/units/ib_common.zsh @@ -16,7 +16,7 @@ then output_text="Unsupported Image Board" notification_text="${output_text}" - return 0 + return fi shift @@ -25,7 +25,7 @@ else output_text="You must specify Image Board and post ID or MD5 hash" notification_text="${output_text}" - return 0 + return fi if [[ -n "${1}" ]] @@ -37,7 +37,7 @@ else output_text="You must specify post ID or MD5 hash" notification_text="${output_text}" - return 0 + return fi if [[ ${#ib_post_id} -eq 32 ]] diff --git a/units/ib_file.zsh b/units/ib_file.zsh index 1fd5ccb..57fe98a 100644 --- a/units/ib_file.zsh +++ b/units/ib_file.zsh @@ -9,7 +9,7 @@ then if [[ $((ib_ctime - ib_mtime)) -le ${cache_time} ]] then - return 0 + return fi fi @@ -19,7 +19,7 @@ then if [[ -n "${output_text}" ]] then - return 0 + return fi fi @@ -72,7 +72,7 @@ then next_offset=${inline_page:-0} rm -f "${ib_file}" - return 0 + return fi if ! jq -e '.' "${ib_file}" > /dev/null @@ -85,7 +85,7 @@ then source "${units}/log.zsh" rm -f "${ib_file}" - return 0 + return fi if ! jq -e ".${ib_iarray}[0]|has(\"${ib_iid}\")" "${ib_file}" > /dev/null diff --git a/units/ib_name.zsh b/units/ib_name.zsh index b15becc..3a8346d 100644 --- a/units/ib_name.zsh +++ b/units/ib_name.zsh @@ -4,7 +4,7 @@ if [[ -n "${1}" ]] then - return 0 + return fi reply_text="$(jq -r '.message.reply_to_message.text' <<< "${update}")" @@ -17,7 +17,7 @@ fi if [[ "${reply_text}" == "null" ]] then output_text="You must specify Image Board and post ID or MD5 hash, or use this command in reply to a message" - return 0 + return fi ib_reply_name="$(sed '1!d' <<< "${reply_text}")" @@ -35,7 +35,7 @@ done if [[ "${ib_board}" == "0" ]] then output_text="Could not find Image Board in replied message" - return 0 + return fi ib_post_id="$(sed '2!d' <<< "${reply_text}" | cut -d ' ' -f 2)" @@ -43,7 +43,7 @@ ib_post_id="$(sed '2!d' <<< "${reply_text}" | cut -d ' ' -f 2)" if [[ -z "${ib_post_id}" ]] then output_text="Could not find post ID in replied message" - return 0 + return fi set -- ${ib_board} ${ib_post_id} diff --git a/units/ib_original.zsh b/units/ib_original.zsh index 93938b2..d04e613 100644 --- a/units/ib_original.zsh +++ b/units/ib_original.zsh @@ -17,7 +17,7 @@ then source "${units}/ib_meta.zsh" else output_text="No original file found" - return 0 + return fi if [[ -n "${ib_file_size}" && "${ib_file_size}" != "null" && ${ib_file_size} -gt 0 ]] diff --git a/units/ib_search.zsh b/units/ib_search.zsh index 1ddb920..6dac4d3 100644 --- a/units/ib_search.zsh +++ b/units/ib_search.zsh @@ -14,7 +14,7 @@ then output_title="Invalid arguments" output_text="Unsupported Image Board" - return 0 + return fi shift @@ -22,7 +22,7 @@ else output_title="Invalid arguments" output_text="You must specify Image Board" - return 0 + return fi if test "${1}" -gt 0 @@ -52,7 +52,7 @@ then output_title="Invalid arguments" output_text="Unsupported options" - return 0 + return fi fi diff --git a/units/ib_size.zsh b/units/ib_size.zsh index e252231..317ffe8 100644 --- a/units/ib_size.zsh +++ b/units/ib_size.zsh @@ -4,12 +4,12 @@ if [[ -n "${ib_file_size}" && "${ib_file_size}" != "null" ]] then - return 0 + return fi if [[ -z "${ib_file_url}" || "${ib_file_url}" == "null" ]] then - return 0 + return fi ib_file_size="$( diff --git a/units/log.zsh b/units/log.zsh index 9c7596b..6127a0b 100644 --- a/units/log.zsh +++ b/units/log.zsh @@ -4,7 +4,7 @@ if [[ -n "${no_logs}" ]] && ! grep -q -e "^Error:" -e "^Warning:" <<< "${log_text}" then - return 0 + return fi printf "[%s] %s\n" "$(strftime "%Y-%m-%d %X")" "${log_text}" diff --git a/units/shorts_search.zsh b/units/shorts_search.zsh index dbf30b2..c84e97f 100644 --- a/units/shorts_search.zsh +++ b/units/shorts_search.zsh @@ -29,7 +29,7 @@ then output_title="Invalid arguments" output_text="Unsupported options" - return 0 + return fi fi @@ -56,7 +56,7 @@ then output_title="No shortcuts found" output_text="You have no saved shortcuts yet" - return 0 + return fi if [[ -n "${shorts_query}" ]] diff --git a/units/sn_auth.zsh b/units/sn_auth.zsh index 826437b..ca3fa2f 100644 --- a/units/sn_auth.zsh +++ b/units/sn_auth.zsh @@ -8,13 +8,13 @@ then elif [[ -f "${user_config}/saucenao" ]] then sn_key="$(< "${user_config}/saucenao")" - return 0 + return elif [[ -n "${sn_key}" ]] then - return 0 + return else output_text="You must provide your SauceNAO API key before you can use SauceNAO" - return 0 + return fi if ! sn_data="$( @@ -37,7 +37,7 @@ then log_text="sn_auth (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi if ! jq -e '.' <<< "${sn_data}" > /dev/null @@ -47,7 +47,7 @@ then log_text="sn_auth (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi sn_status="$(jq -r '.header.status' <<< "${sn_data}")" diff --git a/units/sn_get.zsh b/units/sn_get.zsh index 9e3c18b..d9eb46f 100644 --- a/units/sn_get.zsh +++ b/units/sn_get.zsh @@ -10,13 +10,13 @@ then if [[ "${message_id}" == "null" || "${message_id}" == "${message_thread_id}" ]] then output_text="You must use this command in reply to an image" - return 0 + return fi if [[ "${file_id}" == "null" ]] then output_text="Could not find image in replied message" - return 0 + return fi fi @@ -39,7 +39,7 @@ then log_text="getFile (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - return 0 + return fi if ! jq -e '.' <<< "${output_data}" > /dev/null @@ -49,7 +49,7 @@ then log_text="getFile (${update_id}): An unknown error occurred" source "${units}/log.zsh" - return 0 + return fi if [[ "$(jq -r '.ok' <<< "${output_data}")" != "true" ]] @@ -65,7 +65,7 @@ then fi source "${units}/log.zsh" - return 0 + return fi file_path="$(jq -r '.result.file_path' <<< "${output_data}")" @@ -95,7 +95,7 @@ then log_text="getFile (${update_id}): Failed to access Telegram Bot API" source "${units}/log.zsh" - return 0 + return fi if [[ "$(jq -r '.ok' "${output_file}")" == "false" ]] @@ -111,7 +111,7 @@ then fi source "${units}/log.zsh" - return 0 + return fi file_path="${output_file}" diff --git a/units/sn_search.zsh b/units/sn_search.zsh index 826f8ed..892cfa6 100644 --- a/units/sn_search.zsh +++ b/units/sn_search.zsh @@ -30,7 +30,7 @@ then log_text="sn_search (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi if ! jq -e '.' <<< "${sn_data}" > /dev/null @@ -40,7 +40,7 @@ then log_text="sn_search (${update_id}): ${output_text}" source "${units}/log.zsh" - return 0 + return fi sn_status="$(jq -r '.header.status' <<< "${sn_data}")" diff --git a/units/stop.zsh b/units/stop.zsh index 66a16e0..43a2fe7 100644 --- a/units/stop.zsh +++ b/units/stop.zsh @@ -10,7 +10,7 @@ fi if [[ ${#user_data} -eq 0 ]] then output_text="You have no data to remove" - return 0 + return fi output_text="Remove all your data or specific one" |
