aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Lisina <sekoohaka.sarisan@gmail.com>2026-07-03 20:49:48 +0300
committerMaria Lisina <sekoohaka.sarisan@gmail.com>2026-07-03 20:49:48 +0300
commit70339834fe90513e80c6f060626a32de352e6f14 (patch)
treea06b103a3637251b637fed16cea518f01231cc12
parent387a361439eb0714c14011d7b04f4aa18fa23fdc (diff)
*/*: Bring back old board_table
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
-rwxr-xr-xbot.zsh9
-rw-r--r--operators/command_hash.zsh9
-rw-r--r--units/ib_hash.zsh2
-rw-r--r--units/ib_name.zsh11
4 files changed, 21 insertions, 10 deletions
diff --git a/bot.zsh b/bot.zsh
index c96fe7a..2f728d9 100755
--- a/bot.zsh
+++ b/bot.zsh
@@ -33,7 +33,14 @@ units="${dir}/units"
users="${dir}/users"
offset=-1
-board_table=(a d i s k y)
+board_table=(
+ a "Safebooru"
+ d "Danbooru"
+ i "Idol Complex"
+ s "Sankaku Channel"
+ k "Konachan"
+ y "Yandere"
+)
data_table=(
safebooru "Safebooru"
diff --git a/operators/command_hash.zsh b/operators/command_hash.zsh
index 530fee7..3ced3c9 100644
--- a/operators/command_hash.zsh
+++ b/operators/command_hash.zsh
@@ -28,21 +28,21 @@ do
done
done
-for ib_board in ${board_table[@]}
+while [[ ${#board_table} -ge 2 ]]
do
- source "${units}/ib_config.zsh"
source "${units}/ib_hash.zsh" &
wait
if ! [[ -f "${ib_post}" ]]
then
+ shift 2 board_table
continue
fi
ib_id="$(< "${ib_post}")"
- keyboard_text1="${ib_name}"
- keyboard_query1="post ${ib_board} ${ib_id}"
+ keyboard_text1="${board_table[2]}"
+ keyboard_query1="post ${board_table[1]} ${ib_id}"
reply_markup="$(
jq --compact-output \
@@ -54,6 +54,7 @@ do
)"
keyboard_offset=$((keyboard_offset + 0.5))
+ shift 2 board_table
done
if [[ -f "${ib_sample}" ]]
diff --git a/units/ib_hash.zsh b/units/ib_hash.zsh
index a9b4ff6..3e14a19 100644
--- a/units/ib_hash.zsh
+++ b/units/ib_hash.zsh
@@ -3,6 +3,8 @@
# SPDX-License-Identifier: Apache-2.0
rm -f "${ib_post}"
+
+ib_board="${board_table[1]}"
ib_mode="p"
source "${units}/ib_config.zsh"
diff --git a/units/ib_name.zsh b/units/ib_name.zsh
index 808029f..5f780f2 100644
--- a/units/ib_name.zsh
+++ b/units/ib_name.zsh
@@ -22,18 +22,19 @@ fi
ib_reply_name="$(sed '1!d' <<< "${reply_text}")"
-for ib_board in ${board_table[@]}
+while [[ ${#board_table} -ge 2 ]]
do
- source "${units}/ib_config.zsh"
-
- if [[ "${ib_reply_name}" == "${ib_name}" ]]
+ if [[ "${ib_reply_name}" == "${board_table[2]}" ]]
then
+ ib_board="${board_table[1]}"
break
- elif [[ "${ib_board}" == "${board_table[-1]}" ]]
+ elif [[ "${board_table[1]}" == "${board_table[-2]}" ]]
then
output_text="Could not find Image Board in replied message"
return
fi
+
+ shift 2 board_table
done
ib_post_id="$(sed '2!d' <<< "${reply_text}" | cut -F 2)"