diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-10-02 15:30:55 +0500 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-10-02 15:30:55 +0500 |
| commit | 01945d89b2e762a4728c08ed3a40657b06acde55 (patch) | |
| tree | 752fae0e127887e56c7d72e4fad8a10ba01d7de9 | |
| parent | 8ba674bbee573acd72df56fe5ab1d33719319d53 (diff) | |
*/*: Remove unused command /parent
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | files/help.txt.default | 1 | ||||
| -rw-r--r-- | modules/commands.zsh | 3 | ||||
| -rw-r--r-- | submodules/command_parent.zsh | 49 | ||||
| -rw-r--r-- | units/ib_common.zsh | 8 | ||||
| -rw-r--r-- | units/ib_file.zsh | 3 | ||||
| -rw-r--r-- | units/ib_name.zsh | 8 |
7 files changed, 2 insertions, 71 deletions
@@ -132,7 +132,6 @@ Cache modes: * `/authorize [b] [login] [key]` - Authorize to Image Board * `/original [b] [id/md5]` - Get original file of post * `/post [b] [id/md5]` - Get information of post -* `/parent [b] [id]` - Get children posts IDs * `/hash [md5]` - Get posts IDs by hash lookup * `/source [snkey]` - Reverse search image * `/short [query]` - Create inline shortcut diff --git a/files/help.txt.default b/files/help.txt.default index da5e578..75dec3a 100644 --- a/files/help.txt.default +++ b/files/help.txt.default @@ -40,7 +40,6 @@ /authorize [b] [login] [key] - Authorize to Image Board /original [b] [id/md5] - Get original file of post /post [b] [id/md5] - Get information of post -/parent [b] [id] - Get children posts IDs /hash [md5] - Get posts IDs by hash lookup /source [snkey] - Reverse search image /short [query] - Create inline shortcut diff --git a/modules/commands.zsh b/modules/commands.zsh index 37fbe15..0eeeeeb 100644 --- a/modules/commands.zsh +++ b/modules/commands.zsh @@ -51,9 +51,6 @@ case "${command}" in ("/original" | "/original@${username}") . "${submods}/command_original.zsh" ;; - ("/parent" | "/parent@${username}") - . "${submods}/command_parent.zsh" - ;; ("/ping" | "/ping@${username}") . "${submods}/command_ping.zsh" ;; diff --git a/submodules/command_parent.zsh b/submodules/command_parent.zsh deleted file mode 100644 index 31df5cb..0000000 --- a/submodules/command_parent.zsh +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2024-2025 Maria Lisina -# Copyright (C) 2024-2025 Danil Lisin -# SPDX-License-Identifier: Apache-2.0 - -ib_parent=0 -. "${units}/ib_name.zsh" - -if [[ -n "${output_text}" ]] -then - return 0 -fi - -. "${units}/ib_common.zsh" - -if [[ -n "${output_text}" ]] -then - return 0 -fi - -ib_hash="$(sha1sum <<< "${user_id}${ib_board}${ib_query}" | cut -d ' ' -f 1)" -ib_file="${cache}/${ib_hash}.json" - -until mkdir "${cache}/${ib_hash}.lock" -do - sleep 1 -done - -. "${units}/ib_file.zsh" - -if [[ -n "${output_text}" ]] -then - rmdir "${cache}/${ib_hash}.lock" - return 0 -fi - -ib_children_ids=($(jq -r ".${ib_iarray}[].${ib_iid}" "${ib_file}")) -output_text="<b>Children posts:</b> ${#ib_children_ids}" - -keyboard_text1="Search posts" -keyboard_query1="posts ${ib_board} parent:${ib_post_id}" - -reply_markup="$( - jq --null-input --compact-output \ - --arg text1 "${keyboard_text1}" \ - --arg query1 "${keyboard_query1}" \ - '.inline_keyboard[0] += [{"text": $text1, "switch_inline_query_current_chat": $query1}]' -)" - -rmdir "${cache}/${ib_hash}.lock" diff --git a/units/ib_common.zsh b/units/ib_common.zsh index 78571c7..da257a8 100644 --- a/units/ib_common.zsh +++ b/units/ib_common.zsh @@ -32,9 +32,6 @@ if [[ -n "${1}" ]] then ib_post_id="${1}" shift -elif [[ -n "${ib_parent}" ]] -then - output_text="You must specify parent post ID" else output_title="Invalid arguments" output_text="You must specify post ID or MD5 hash" @@ -43,10 +40,7 @@ else return 0 fi -if [[ -n "${ib_parent}" ]] -then - ib_query="parent:${ib_post_id}" -elif [[ ${#ib_post_id} -eq 32 ]] +if [[ ${#ib_post_id} -eq 32 ]] then ib_query="md5:${ib_post_id}" else diff --git a/units/ib_file.zsh b/units/ib_file.zsh index 85b2c6b..8fdd40f 100644 --- a/units/ib_file.zsh +++ b/units/ib_file.zsh @@ -110,9 +110,6 @@ then output_text="Try different page or tag name" ;; esac - elif [[ -n "${ib_parent}" ]] - then - output_text="No results found" else output_text="Try different post ID or MD5 hash" fi diff --git a/units/ib_name.zsh b/units/ib_name.zsh index 9e8f392..b6cf26a 100644 --- a/units/ib_name.zsh +++ b/units/ib_name.zsh @@ -16,13 +16,7 @@ fi if [[ "${reply_text}" == "null" ]] then - if [[ -n "${ib_parent}" ]] - then - output_text="You must specify Image Board and parent post ID, or use this command in reply to a message" - else - output_text="You must specify Image Board and post ID or MD5 hash, or use this command in reply to a message" - fi - + output_text="You must specify Image Board and post ID or MD5 hash, or use this command in reply to a message" return 0 fi |
