aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbot.sh5
-rw-r--r--files/help.txt.default61
-rw-r--r--submodules/command_help.sh2
-rw-r--r--submodules/inline_help.sh3
-rw-r--r--units/help.sh87
5 files changed, 68 insertions, 90 deletions
diff --git a/bot.sh b/bot.sh
index 147685b..ff2b757 100755
--- a/bot.sh
+++ b/bot.sh
@@ -301,6 +301,11 @@ then
cat "${files}/whitelist.txt.default" > "${files}/whitelist.txt"
fi
+if ! [ -f "${files}/help.txt" ]
+then
+ cat "${files}/help.txt.default" > "${files}/help.txt"
+fi
+
echo "PID: ${$}"
curl --get \
diff --git a/files/help.txt.default b/files/help.txt.default
new file mode 100644
index 0000000..854da55
--- /dev/null
+++ b/files/help.txt.default
@@ -0,0 +1,61 @@
+<b>Sekoohaka Bot v{version}</b>
+
+<b>Fields descriptions:</b>
+[command] - Inline command
+[b] - Image Board
+[page] - Search page number
+[options] - Search options
+[name] - Search pool or tag name
+[tags] - Search tags
+[query] - Search query
+[id] - Post ID
+[login] - Image Board login or username
+[key] - Image Board API key or password
+
+<b>Inline search:</b>
+<code>pools</code> [b] [page] [options] [name] - Pools search
+<code>posts</code> [b] [page] [options] [tags] - Posts search
+<code>tags</code> [b] [page] [options] [name] - Tags search
+<code>shorts</code> [page] [options] [query] - Shortcuts search
+
+<b>Search options:</b>
+a - Enable autopaging (lpts)
+m - Show more metadata (p)
+p - Show gif/video as preview only (p)
+q - Add quick buttons (lpts)
+r - Reverse search order (s)
+w - Match full words only (s)
+
+<b>Inline commands:</b>
+<code>help</code> - Send this message
+<code>original</code> [b] [id] - Get original file of post
+<code>post</code> [b] [id] - Get infromation of post
+<code>short</code> [query] - Create inline shortcut
+
+<b>Commands:</b>
+/help - Send this message
+/authorize [b] [login] [key] - Authorize to Image Board
+/original [b] [id] - Get original file of post
+/post [b] [id] - Get infromation of post
+/short [query] - Create inline shortcut
+/shorts - Manage saved shortcuts
+/stop - Remove all your data
+
+<b>Inline aliases:</b>
+<code>l</code> - <code>pools</code>
+<code>p</code> - <code>posts</code>
+<code>t</code> - <code>tags</code>
+<code>s</code> - <code>shorts</code>
+<b>Inline examples:</b>
+<code>p d 1 -a rating:g</code>
+<code>t d *genshin*</code>
+<code>original d 4507929</code>
+<code>short p d -mq ringouulu</code>
+
+<b>Supported Image Boards:</b>
+d - <a href="https://danbooru.donmai.us">Danbooru</a> (auth) (lpt)
+g - <a href="https://gelbooru.com">Gelbooru</a> (auth) (pt)
+i - <a href="https://idol.sankakucomplex.com">Idol Complex</a> (auth) (lpt)
+k - <a href="https://konachan.com">Konachan.com</a> (auth) (lpt)
+s - <a href="https://chan.sankakucomplex.com">Sankaku Channel</a> (auth) (lpt)
+y - <a href="https://yande.re">yande.re</a> (auth) (lpt)
diff --git a/submodules/command_help.sh b/submodules/command_help.sh
index 25685e5..50ace88 100644
--- a/submodules/command_help.sh
+++ b/submodules/command_help.sh
@@ -2,7 +2,7 @@
# Copyright (C) 2024-2025 Danil Lisin
# SPDX-License-Identifier: Apache-2.0
-. "${units}/help.sh"
+output_text="$(cat "${files}/help.txt" | sed "s/{version}/${version}/")"
link_preview_options="$(jq --null-input --compact-output \
'{"is_disabled": true}')"
diff --git a/submodules/inline_help.sh b/submodules/inline_help.sh
index 79687c4..c8125a3 100644
--- a/submodules/inline_help.sh
+++ b/submodules/inline_help.sh
@@ -2,8 +2,7 @@
# Copyright (C) 2024-2025 Danil Lisin
# SPDX-License-Identifier: Apache-2.0
-. "${units}/help.sh"
-
+output_text="$(cat "${files}/help.txt" | sed "s/{version}/${version}/")"
output_title="Sekoohaka Bot"
output_description="Click to send the help message"
diff --git a/units/help.sh b/units/help.sh
deleted file mode 100644
index 0e45675..0000000
--- a/units/help.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (C) 2024-2025 Maria Lisina
-# Copyright (C) 2024-2025 Danil Lisin
-# SPDX-License-Identifier: Apache-2.0
-
-output_text="$(echo "<b>Sekoohaka Bot v${version}</b>" \
- "\n\n<b>Fields descriptions:</b>" \
- "\n[command] - Inline command" \
- "\n[b] - Image Board" \
- "\n[page] - Search page number" \
- "\n[options] - Search options" \
- "\n[name] - Search pool or tag name" \
- "\n[tags] - Search tags" \
- "\n[query] - Search query" \
- "\n[id] - Post ID" \
- "\n[login] - Image Board login or username" \
- "\n[key] - Image Board API key or password" \
- "\n\n<b>Inline search:</b>" \
- "\n<code>pools</code> [b] [page] [options] [name] - Pools search" \
- "\n<code>posts</code> [b] [page] [options] [tags] - Posts search" \
- "\n<code>tags</code> [b] [page] [options] [name] - Tags search" \
- "\n<code>shorts</code> [page] [options] [query] - Shortcuts search" \
- "\n\n<b>Search options:</b>" \
- "\na - Enable autopaging (lpts)" \
- "\nm - Show more metadata (p)" \
- "\np - Show gif/video as preview only (p)" \
- "\nq - Add quick buttons (lpts)" \
- "\nr - Reverse search order (s)" \
- "\nw - Match full words only (s)" \
- "\n\n<b>Inline commands:</b>" \
- "\n<code>help</code> - Send this message" \
- "\n<code>original</code> [b] [id] - Get original file of post" \
- "\n<code>post</code> [b] [id] - Get infromation of post" \
- "\n<code>short</code> [query] - Create inline shortcut" \
- "\n\n<b>Commands:</b>" \
- "\n/help - Send this message" \
- "\n/authorize [b] [login] [key] - Authorize to Image Board" \
- "\n/original [b] [id] - Get original file of post" \
- "\n/post [b] [id] - Get infromation of post" \
- "\n/short [query] - Create inline shortcut" \
- "\n/shorts - Manage saved shortcuts" \
- "\n/stop - Remove all your data" \
- "\n\n<b>Inline aliases:</b>" \
- "\n<code>l</code> - <code>pools</code>" \
- "\n<code>p</code> - <code>posts</code>" \
- "\n<code>t</code> - <code>tags</code>" \
- "\n<code>s</code> - <code>shorts</code>" \
- "\n\n<b>Inline examples:</b>" \
- "\n<code>p d 1 -a rating:g</code>" \
- "\n<code>t d *genshin*</code>" \
- "\n<code>original d 4507929</code>" \
- "\n<code>short p d -mq ringouulu</code>" \
- "\n\n<b>Supported Image Boards:</b>")"
-
-for ib_board in ${ascii_table}
-do
- . "${units}/ib_config.sh"
- . "${units}/ib_authconfig.sh"
-
- if [ -n "${ib_name}" ]
- then
- output_text="$(printf '%s\n%c - <a href="%s">%s</a>' "${output_text}" "${ib_board}" "${ib_url}" "${ib_name}")"
-
- for ib_mode in ${ascii_table}
- do
- . "${units}/ib_config.sh"
-
- if [ -n "${ib_data_url}" ]
- then
- ib_features="${ib_features}${ib_mode}"
- fi
-
- unset ib_data_url
- done
-
- if [ -n "${ib_config}" ]
- then
- output_text="$(printf "%s (auth)" "${output_text}")"
- fi
-
- if [ -n "${ib_features}" ]
- then
- output_text="$(printf "%s (%s)" "${output_text}" "${ib_features}")"
- fi
- fi
-
- unset ib_name ib_config ib_features
-done