diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2026-02-07 06:29:44 +0300 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2026-02-07 06:29:44 +0300 |
| commit | aa1ca9fa3c7680fc9157003ab7b1e47fa0ee799a (patch) | |
| tree | 640f352152cec982c4ea867efe90f442f22a9f14 /units | |
| parent | 0671dc134a9e122ce2c0348f3f4deeb2d274d524 (diff) | |
*/*: Reimplement help command
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
Diffstat (limited to 'units')
| -rw-r--r-- | units/help.zsh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/units/help.zsh b/units/help.zsh new file mode 100644 index 0000000..4001020 --- /dev/null +++ b/units/help.zsh @@ -0,0 +1,21 @@ +# Copyright (C) 2024-2026 Maria Lisina +# Copyright (C) 2024-2026 Danil Lisin +# SPDX-License-Identifier: Apache-2.0 + +while [[ ${#help_table} -ge 3 ]] +do + keyboard_text1="${help_table[2]}" + keyboard_data1="help ${help_table[1]}" + + reply_markup="$( + jq --compact-output \ + --argjson offset "$(printf "%u" "${keyboard_offset}")" \ + --arg text1 "${keyboard_text1}" \ + --arg data1 "${keyboard_data1}" \ + '.inline_keyboard[$offset] += [{"text": $text1, "callback_data": $data1}]' \ + <<< "${reply_markup:-"{}"}" + )" + + keyboard_offset=$((keyboard_offset + 0.5)) + shift 3 help_table +done |
