fix(setup): print bot URL alongside the deep-link attempt
Headless / SSH / WSL users won't have \`open\` or \`xdg-open\` wired up, so the deep-link fails silently and they have no clue where to go. Always print https://t.me/<username> so the URL is at least clickable or copy-pasteable from the terminal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -134,21 +134,24 @@ mkdir -p data/env
|
|||||||
cp .env data/env/env
|
cp .env data/env/env
|
||||||
|
|
||||||
# Deep-link into the bot's chat in the installed Telegram app so the user
|
# Deep-link into the bot's chat in the installed Telegram app so the user
|
||||||
# is already on the right screen when pair-telegram prints the code.
|
# is already on the right screen when pair-telegram prints the code. Also
|
||||||
|
# always print the URL so headless / remote-SSH users can open it manually.
|
||||||
if [[ -n "$BOT_USERNAME" ]]; then
|
if [[ -n "$BOT_USERNAME" ]]; then
|
||||||
|
BOT_URL="https://t.me/${BOT_USERNAME}"
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
Darwin)
|
Darwin)
|
||||||
open "tg://resolve?domain=${BOT_USERNAME}" >/dev/null 2>&1 \
|
open "tg://resolve?domain=${BOT_USERNAME}" >/dev/null 2>&1 \
|
||||||
|| open "https://t.me/${BOT_USERNAME}" >/dev/null 2>&1 \
|
|| open "$BOT_URL" >/dev/null 2>&1 \
|
||||||
|| true
|
|| true
|
||||||
;;
|
;;
|
||||||
Linux)
|
Linux)
|
||||||
xdg-open "tg://resolve?domain=${BOT_USERNAME}" >/dev/null 2>&1 \
|
xdg-open "tg://resolve?domain=${BOT_USERNAME}" >/dev/null 2>&1 \
|
||||||
|| xdg-open "https://t.me/${BOT_USERNAME}" >/dev/null 2>&1 \
|
|| xdg-open "$BOT_URL" >/dev/null 2>&1 \
|
||||||
|| true
|
|| true
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "[add-telegram] Opened Telegram → @${BOT_USERNAME}. Keep it open for the pairing code."
|
echo "[add-telegram] Bot chat: ${BOT_URL}"
|
||||||
|
echo "[add-telegram] (If Telegram didn't open automatically, click the link above.)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[add-telegram] Restarting service so the new adapter picks up the token…"
|
echo "[add-telegram] Restarting service so the new adapter picks up the token…"
|
||||||
|
|||||||
Reference in New Issue
Block a user