aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorMaria Lisina <sekoohaka.sarisan@gmail.com>2026-02-15 13:14:03 +0300
committerMaria Lisina <sekoohaka.sarisan@gmail.com>2026-02-15 13:14:03 +0300
commit504b9fca44b0b23ae5256482cefaea476d3ea290 (patch)
treeb31459ee7d40cbb0db96a847e217b6438c959948 /handlers
parentb09241a7f2cf9443a8376a400c9bcc3dc36402e3 (diff)
*/*: Remove extra exit code
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
Diffstat (limited to 'handlers')
-rw-r--r--handlers/callback.zsh8
-rw-r--r--handlers/commands.zsh6
-rw-r--r--handlers/inline.zsh6
-rw-r--r--handlers/source.zsh12
-rw-r--r--handlers/timer.zsh4
5 files changed, 18 insertions, 18 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"