diff options
| -rw-r--r-- | files/commands.json.default | 4 | ||||
| -rw-r--r-- | files/help.txt.default | 2 | ||||
| -rw-r--r-- | handlers/callback.zsh | 6 | ||||
| -rw-r--r-- | handlers/commands.zsh | 6 | ||||
| -rw-r--r-- | operators/callback_ping.zsh (renamed from operators/callback_status.zsh) | 2 | ||||
| -rw-r--r-- | operators/command_ping.zsh (renamed from operators/command_status.zsh) | 2 | ||||
| -rw-r--r-- | units/ping.zsh (renamed from units/status.zsh) | 6 |
7 files changed, 14 insertions, 14 deletions
diff --git a/files/commands.json.default b/files/commands.json.default index dd7d295..1edf500 100644 --- a/files/commands.json.default +++ b/files/commands.json.default @@ -32,8 +32,8 @@ "description": "Manage saved shortcuts" }, { - "command": "status", - "description": "Check bot status" + "command": "ping", + "description": "Measure bot latency" }, { "command": "export", diff --git a/files/help.txt.default b/files/help.txt.default index 459efb1..14f24ea 100644 --- a/files/help.txt.default +++ b/files/help.txt.default @@ -107,7 +107,7 @@ In-chat bot commands /source [snkey] - Reverse search image /short [query] - Create inline shortcut /shorts - Manage saved shortcuts -/status - Check bot status +/ping - Measure bot latency /export - Export all your data /stop - Remove all your data <<<<<<<< diff --git a/handlers/callback.zsh b/handlers/callback.zsh index 5608089..dd9dbf6 100644 --- a/handlers/callback.zsh +++ b/handlers/callback.zsh @@ -34,6 +34,9 @@ case "${command}" in ("help") source "${operators}/callback_help.zsh" ;; + ("ping") + source "${operators}/callback_ping.zsh" + ;; ("post") source "${operators}/callback_post.zsh" ;; @@ -43,9 +46,6 @@ case "${command}" in ("short") source "${operators}/callback_short.zsh" ;; - ("status") - source "${operators}/callback_status.zsh" - ;; ("stop") source "${operators}/callback_stop.zsh" ;; diff --git a/handlers/commands.zsh b/handlers/commands.zsh index a913853..e72a54c 100644 --- a/handlers/commands.zsh +++ b/handlers/commands.zsh @@ -48,6 +48,9 @@ case "${command}" in ("/original" | "/original@${username}") source "${operators}/command_original.zsh" ;; + ("/ping" | "/ping@${username}") + source "${operators}/command_ping.zsh" + ;; ("/post" | "/post@${username}") source "${operators}/command_post.zsh" ;; @@ -66,9 +69,6 @@ case "${command}" in ("/start" | "/start@${username}") source "${operators}/command_help.zsh" ;; - ("/status" | "/status@${username}") - source "${operators}/command_status.zsh" - ;; ("/stop" | "/stop@${username}") source "${operators}/command_stop.zsh" ;; diff --git a/operators/callback_status.zsh b/operators/callback_ping.zsh index 1121c9f..b728bc4 100644 --- a/operators/callback_status.zsh +++ b/operators/callback_ping.zsh @@ -57,4 +57,4 @@ then return fi -. "${units}/status.zsh" +. "${units}/ping.zsh" diff --git a/operators/command_status.zsh b/operators/command_ping.zsh index 86fab4e..546e588 100644 --- a/operators/command_status.zsh +++ b/operators/command_ping.zsh @@ -59,7 +59,7 @@ then fi message_id="$(jq -r '.result.message_id' <<< "${output_data}")" -. "${units}/status.zsh" +. "${units}/ping.zsh" if ! output_data="$( curl --connect-timeout ${connrefused_timeout} \ diff --git a/units/status.zsh b/units/ping.zsh index 09d4b88..3fe85b5 100644 --- a/units/status.zsh +++ b/units/ping.zsh @@ -30,11 +30,11 @@ done latency_text=$(((latency_fin - latency_init) / 1000000)) -output_text="$(printf "<b>Bot Status</b>\n<b>Uptime:</b>%s" "${uptime_text}")" +output_text="$(printf "<b>Uptime:</b>%s" "${uptime_text}")" output_text="$(printf "%s\n<b>Latency:</b> %ums" "${output_text}" "${latency_text}")" -keyboard_text1="Update" -keyboard_data1="status" +keyboard_text1="Refresh" +keyboard_data1="ping" reply_markup="$( jq --null-input --compact-output \ |
