aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Lisina <sekoohaka.sarisan@gmail.com>2025-12-01 22:58:59 +0300
committerMaria Lisina <sekoohaka.sarisan@gmail.com>2025-12-01 22:58:59 +0300
commit42a8a5ac964deb2ede789366d50b6dc013d5b400 (patch)
treeef2d908ede09ee4b53769cf230f8a3672b729124
parent7cb5b7516b48946c44dfd29c6c494296707d10ee (diff)
bot: Load files within check
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
-rwxr-xr-xbot.zsh21
-rw-r--r--files/help.txt.default2
2 files changed, 5 insertions, 18 deletions
diff --git a/bot.zsh b/bot.zsh
index 7f09acf..f3ac8c9 100755
--- a/bot.zsh
+++ b/bot.zsh
@@ -517,9 +517,9 @@ done
log_text="Running help command check..."
. "${units}/log.zsh"
-file_content="$(< "${files}/help.txt")"
+help_content="$(sed "s/{version_placeholder}/${version}/" "${files}/help.txt")"
-if [[ ${#file_content} -lt 1 ]]
+if [[ ${#help_content} -lt 1 ]]
then
log_text="Error: File help.txt must be at least 1 character long"
. "${units}/log.zsh"
@@ -530,9 +530,9 @@ fi
log_text="Running donate command check..."
. "${units}/log.zsh"
-file_content="$(< "${files}/donate.txt")"
+donate_content="$(< "${files}/donate.txt")"
-if [[ ${#file_content} -lt 1 ]]
+if [[ ${#donate_content} -lt 1 ]]
then
nocommand_donate=0
@@ -750,14 +750,6 @@ then
esac
fi
-log_text="Loading files..."
-. "${units}/log.zsh"
-
-log_text="files/help.txt"
-. "${units}/log.zsh"
-
-help_content="$(sed "s/{version}/${version}/" < "${files}/help.txt")"
-
if [[ -n "${nocommand_donate}" ]]
then
help_content="$(sed -e '/^<code>donate.*$/d' -e '/^\/donate.*$/d' <<< "${help_content}")"
@@ -768,11 +760,6 @@ then
help_content="$(sed -e '/^\[snkey\].*$/d' -e '/^\/source.*$/d' <<< "${help_content}")"
fi
-log_text="files/donate.txt"
-. "${units}/log.zsh"
-
-donate_content="$(< "${files}/donate.txt")"
-
strftime %s > "${cache}.timer"
log_text="Startup succeeded"
diff --git a/files/help.txt.default b/files/help.txt.default
index 241f5a2..00b5b26 100644
--- a/files/help.txt.default
+++ b/files/help.txt.default
@@ -1,4 +1,4 @@
-<b>Sekoohaka Bot v{version}</b>
+<b>Sekoohaka Bot v{version_placeholder}</b>
<b>Fields descriptions:</b>
[command] - Inline command