diff options
Diffstat (limited to 'handlers')
| -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 |
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" |
