diff --git a/docs/content/docs/en/operations/telegram-bot.mdx b/docs/content/docs/en/operations/telegram-bot.mdx index 40acd2324..70f1fbd37 100644 --- a/docs/content/docs/en/operations/telegram-bot.mdx +++ b/docs/content/docs/en/operations/telegram-bot.mdx @@ -6,7 +6,7 @@ icon: Send 3x-ui can drive a Telegram bot for monitoring, alerts, backups, and remote management. Admins get full control; regular users (linked by Telegram ID) can -check their own usage and links. +check their own usage and fetch their links and setup guides. Looking for news and community support? Join the official Telegram channel @@ -80,7 +80,9 @@ clients, "depleting soon", and a full **add-client** wizard. The admin's **client card** carries the client's subscription link, individual links and QR code, so a config can be handed to a client who cannot reach Telegram yet. Regular users get buttons for their own usage, subscription links, individual -links, and QR codes. +links, QR codes, **Get one** (pick one link and get it alone, with its own QR +code), and a per-platform **Setup guide**. Every links page opens with the +config's expiry date and the traffic it has left. ## Reports & alerts diff --git a/docs/content/docs/fa/operations/telegram-bot.mdx b/docs/content/docs/fa/operations/telegram-bot.mdx index b8c3f5417..1971edc52 100644 --- a/docs/content/docs/fa/operations/telegram-bot.mdx +++ b/docs/content/docs/fa/operations/telegram-bot.mdx @@ -6,7 +6,7 @@ icon: Send 3x-ui می‌تواند یک ربات Telegram را برای پایش، هشدار، پشتیبان‌گیری و مدیریت از راه دور به کار گیرد. ادمین‌ها کنترل کامل دارند؛ کاربران عادی (که با Telegram ID پیوند خورده‌اند) -می‌توانند مصرف و لینک‌های خودشان را بررسی کنند. +می‌توانند مصرف خودشان را بررسی کنند و لینک‌ها و راهنمای نصب را بگیرند. دنبال اخبار و پشتیبانی انجمن هستید؟ به کانال رسمی Telegram یعنی @@ -79,7 +79,9 @@ icon: Send کلاینت‌های آنلاین، «به‌زودی تمام‌شونده» و یک جادوگر کامل **افزودن کلاینت** را در اختیار دارند. کارت **کلاینت** در اختیار ادمین است و لینک اشتراک، لینک‌های منفرد و کد QR کلاینت را نشان می‌دهد، تا کانفیگ را بتوان به کلاینتی که هنوز به Telegram دسترسی ندارد هم داد. -کاربران عادی دکمه‌هایی برای مصرف خودشان، لینک‌های اشتراک، لینک‌های منفرد و کدهای QR دارند. +کاربران عادی دکمه‌هایی برای مصرف خودشان، لینک‌های اشتراک، لینک‌های منفرد، کدهای QR، +**دریافت یکی** (انتخاب یک لینک و دریافت جداگانه‌ی آن همراه با کد QR خودش) و **راهنمای نصب** +برای هر پلتفرم دارند. هر صفحه‌ی لینک با تاریخ انقضای کانفیگ و ترافیک باقی‌مانده‌ی آن شروع می‌شود. ## گزارش‌ها و هشدارها diff --git a/docs/content/docs/ru/operations/telegram-bot.mdx b/docs/content/docs/ru/operations/telegram-bot.mdx index 87b5ad4f6..b78942914 100644 --- a/docs/content/docs/ru/operations/telegram-bot.mdx +++ b/docs/content/docs/ru/operations/telegram-bot.mdx @@ -7,7 +7,7 @@ icon: Send 3x-ui умеет управлять Telegram-ботом для мониторинга, оповещений, резервного копирования и удалённого управления. Администраторы получают полный контроль; обычные пользователи (привязанные по Telegram ID) могут проверять собственный -расход трафика и ссылки. +расход трафика и получать ссылки и инструкции по настройке. Ищете новости и поддержку сообщества? Присоединяйтесь к официальному @@ -84,7 +84,9 @@ ID темы после двоеточия, например `-1001234567890:42`. клиента администратор получает ссылку на подписку, отдельные ссылки и QR-код — конфигурацию можно передать клиенту, который ещё не может открыть Telegram. Обычным пользователям доступны кнопки для своего расхода, ссылок на подписку, -отдельных ссылок и QR-кодов. +отдельных ссылок, QR-кодов, **Получить один** (выбрать одну ссылку и получить её +отдельно, со своим QR-кодом) и **Инструкция** по настройке для каждой платформы. +Каждая страница ссылок начинается с даты окончания конфигурации и остатка трафика. ## Отчёты и оповещения diff --git a/docs/content/docs/zh/operations/telegram-bot.mdx b/docs/content/docs/zh/operations/telegram-bot.mdx index 02f7f2c13..0d304b644 100644 --- a/docs/content/docs/zh/operations/telegram-bot.mdx +++ b/docs/content/docs/zh/operations/telegram-bot.mdx @@ -6,7 +6,7 @@ icon: Send 3x-ui 可以驱动一个 Telegram 机器人,用于监控、告警、备份和远程管理。 管理员拥有完全的控制权;普通用户(通过 Telegram ID 关联)则可以 -查询自己的用量和链接。 +查询自己的用量,获取链接和使用指南。 想获取最新动态和社区支持?欢迎加入官方 Telegram 频道 @@ -74,7 +74,9 @@ ID 的所有客户端。订阅 ID 就是邀请码,因此请保持其足够长 “即将耗尽”,以及完整的**添加客户端**向导。管理员的**客户端卡片**上还带有该客户端的 订阅链接、单条链接和 QR 码,因此可以把配置交给暂时还无法打开 Telegram 的客户端。 普通用户则可以使用按钮查看 -自己的用量、订阅链接、单条链接和 QR 码。 +自己的用量、订阅链接、单条链接和 QR 码,使用**获取单个**(挑选一条链接, +单独获取它及其专属 QR 码),以及按平台分类的**使用指南**。每个链接页面 +开头都会显示该配置的到期日期和剩余流量。 ## 报告与告警 diff --git a/internal/web/service/tgbot/screen_client_guide.go b/internal/web/service/tgbot/screen_client_guide.go new file mode 100644 index 000000000..cb542f9b0 --- /dev/null +++ b/internal/web/service/tgbot/screen_client_guide.go @@ -0,0 +1,63 @@ +package tgbot + +import ( + "strings" + + "github.com/mymmrac/telego" + tu "github.com/mymmrac/telego/telegoutil" +) + +const ( + cbClientGuide = "client_guide" + guideCallbackPrefix = "guide_" +) + +// guidePlatform is one entry in the setup picker. The message key comes from this +// table rather than the tag, so callback data can never reach the localizer. +type guidePlatform struct { + tag string + labelKey string + messageKey string +} + +var guidePlatforms = []guidePlatform{ + {tag: "ios", labelKey: "tgbot.buttons.guideIos", messageKey: "tgbot.messages.guideIos"}, + {tag: "android", labelKey: "tgbot.buttons.guideAndroid", messageKey: "tgbot.messages.guideAndroid"}, + {tag: "windows", labelKey: "tgbot.buttons.guideWindows", messageKey: "tgbot.messages.guideWindows"}, + {tag: "macos", labelKey: "tgbot.buttons.guideMacos", messageKey: "tgbot.messages.guideMacos"}, + {tag: "linux", labelKey: "tgbot.buttons.guideLinux", messageKey: "tgbot.messages.guideLinux"}, +} + +func parseGuideCallback(data string) (string, bool) { + tag, found := strings.CutPrefix(data, guideCallbackPrefix) + if !found { + return "", false + } + for _, platform := range guidePlatforms { + if platform.tag == tag { + return platform.messageKey, true + } + } + return "", false +} + +// The steps send the customer to their links page, so it is one tap away; the +// bare verb resolves their own config, or asks which one. +func (t *Tgbot) guideRows() [][]telego.InlineKeyboardButton { + buttons := make([]telego.InlineKeyboardButton, 0, len(guidePlatforms)) + for _, platform := range guidePlatforms { + buttons = append(buttons, t.btn(platform.labelKey, guideCallbackPrefix+platform.tag)) + } + rows := tu.InlineKeyboardCols(2, buttons...) + return append(rows, tu.InlineKeyboardRow(t.btn("tgbot.buttons.links", "client_sub_links"))) +} + +// screenGuide draws the platform picker, under the chosen platform's steps when +// there is one, so a customer can compare two platforms without walking back. +func (t *Tgbot) screenGuide(chatID int64, messageKey string) { + body := t.I18nBot("tgbot.messages.guideChoose") + if messageKey != "" { + body = t.I18nBot(messageKey) + } + t.renderScreen(chatID, t.newScreen("guide", body, t.guideRows()...)) +} diff --git a/internal/web/service/tgbot/screen_client_guide_test.go b/internal/web/service/tgbot/screen_client_guide_test.go new file mode 100644 index 000000000..c8068cc50 --- /dev/null +++ b/internal/web/service/tgbot/screen_client_guide_test.go @@ -0,0 +1,82 @@ +package tgbot + +import ( + "strings" + "testing" +) + +// The picker and the customer gate are maintained apart, so a platform added to +// one and not the other renders a button that the gate silently drops. +func TestGuidePlatformsArePickableAndAllowed(t *testing.T) { + tg := &Tgbot{} + var data []string + for _, row := range tg.guideRows() { + for _, button := range row { + data = append(data, button.CallbackData) + } + } + for _, callback := range data { + if !isClientSelfCallback(callback) { + t.Errorf("the guide offers %q, which the customer gate refuses", callback) + } + } + for _, platform := range guidePlatforms { + if !strings.Contains(strings.Join(data, " "), guideCallbackPrefix+platform.tag) { + t.Errorf("the picker is missing %q: %v", platform.tag, data) + } + } +} + +// The tag arrives as callback data, so an unknown one must resolve to nothing +// rather than reaching the localizer as an arbitrary key. +func TestParseGuideCallback(t *testing.T) { + tests := []struct { + name string + data string + want string + ok bool + }{ + {name: "known platform", data: "guide_ios", want: "tgbot.messages.guideIos", ok: true}, + {name: "another platform", data: "guide_android", want: "tgbot.messages.guideAndroid", ok: true}, + {name: "unknown platform", data: "guide_symbian", ok: false}, + {name: "no platform", data: "guide_", ok: false}, + {name: "bare prefix", data: "guide", ok: false}, + {name: "traversal", data: "guide_../../etc/passwd", ok: false}, + {name: "key injection", data: "guide_tgbot.messages.adminPanel", ok: false}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + got, ok := parseGuideCallback(tc.data) + if ok != tc.ok || got != tc.want { + t.Fatalf("parseGuideCallback(%q) = (%q, %v), want (%q, %v)", tc.data, got, ok, tc.want, tc.ok) + } + }) + } +} + +// A customer reaches the guide from home and reads the chosen platform's steps +// on the same screen, whether they hold one config or several. +func TestCustomerOpensTheSetupGuideFromHome(t *testing.T) { + localizeWithRealBundle(t) + tb, _ := newScreenTgbot(t, false) + initReportDB(t) + setTestAdmins(t) + seedClientForTgUser(t, 4242, "solo@x") + seedClientForTgUser(t, 5353, "first@x") + seedClientForTgUser(t, 5353, "second@x") + + tb.screenClientHome(4242, 4242) + if markup := screenMarkup(t, tb, 4242); !strings.Contains(markup, `"`+cbClientGuide+`"`) || !strings.Contains(markup, `"client_one_link"`) { + t.Errorf("the one-config home lacks Get one or the guide: %s", markup) + } + tb.screenClientHome(5353, 5353) + if markup := screenMarkup(t, tb, 5353); !strings.Contains(markup, `"`+cbClientGuide+`"`) { + t.Errorf("the several-config home lacks the guide: %s", markup) + } + + tapClientLinks(t, tb, 4242, "guide_android") + sc, _ := tb.screens().get(4242) + if !strings.Contains(sc.body, "v2rayNG") { + t.Errorf("the Android steps are not on the screen: %q", sc.body) + } +} diff --git a/internal/web/service/tgbot/screen_client_header.go b/internal/web/service/tgbot/screen_client_header.go new file mode 100644 index 000000000..f30a11712 --- /dev/null +++ b/internal/web/service/tgbot/screen_client_header.go @@ -0,0 +1,52 @@ +package tgbot + +import ( + "fmt" + "time" + + "github.com/mhsanaei/3x-ui/v3/internal/logger" + "github.com/mhsanaei/3x-ui/v3/internal/util/common" +) + +// A config with no quota reports unlimited rather than zero left, which a +// customer would read as being cut off. +func remainingBytes(used, total int64) (int64, bool) { + if total <= 0 { + return 0, false + } + if used >= total { + return 0, true + } + return total - used, true +} + +// headerExpiry renders the expiry the way the client card does: a negative +// value counts days from first use rather than naming a date. +func (t *Tgbot) headerExpiry(expiryTime int64) string { + switch { + case expiryTime == 0: + return t.I18nBot("tgbot.unlimited") + case expiryTime < 0: + return fmt.Sprintf("%d %s", expiryTime/-86400000, t.I18nBot("tgbot.days")) + default: + return time.UnixMilli(expiryTime).Format("2006-01-02") + } +} + +// clientHeader says which config a link page shows and how much of it is left, +// so a customer holding several does not have to guess from the links. +func (t *Tgbot) clientHeader(email string) string { + traffic, err := t.inboundService.GetClientTrafficByEmail(email) + if err != nil || traffic == nil { + logger.Warning("tgbot: link page header lookup failed for", email, ":", err) + return t.clientScreenBody(email, "") + } + remaining := t.I18nBot("tgbot.unlimited") + if left, limited := remainingBytes(traffic.Up+traffic.Down, traffic.Total); limited { + remaining = common.FormatTraffic(left) + } + return t.I18nBot("tgbot.messages.clientHeader", + "Email=="+email, + "Expiry=="+t.headerExpiry(traffic.ExpiryTime), + "Remaining=="+remaining) + "\r\n\r\n" +} diff --git a/internal/web/service/tgbot/screen_client_header_test.go b/internal/web/service/tgbot/screen_client_header_test.go new file mode 100644 index 000000000..498f3b0a5 --- /dev/null +++ b/internal/web/service/tgbot/screen_client_header_test.go @@ -0,0 +1,88 @@ +package tgbot + +import ( + "strings" + "testing" + "time" + + "github.com/mhsanaei/3x-ui/v3/internal/database" +) + +// Every link page opens with what is left of the config: a dated expiry, the +// bytes remaining, and unlimited where there is no limit rather than zero. +func TestClientHeaderSaysWhatIsLeft(t *testing.T) { + localizeWithRealBundle(t) + tb, _ := newScreenTgbot(t, false) + initReportDB(t) + setTestAdmins(t) + seedClientForTgUser(t, 4242, "left@x") + const gb = int64(1 << 30) + expiry := time.Date(2031, 3, 14, 12, 0, 0, 0, time.Local).UnixMilli() + + tests := []struct { + name string + up, total int64 + expiry int64 + want, avoid []string + }{ + {"limited and dated", 30 * gb, 100 * gb, expiry, []string{"2031-03-14", "70.00GB"}, nil}, + {"overspent never goes negative", 150 * gb, 100 * gb, expiry, []string{"📊 0.00B"}, []string{"📊 -"}}, + {"no limits", 5 * gb, 0, 0, []string{tb.I18nBot("tgbot.unlimited")}, []string{"0.00B", "1970"}}, + {"counts from first use", 0, 0, -30 * 86400000, []string{"30 " + tb.I18nBot("tgbot.days")}, []string{"1969"}}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + if err := database.GetDB().Exec("UPDATE client_traffics SET up = ?, down = 0, total = ?, expiry_time = ? WHERE email = ?", + tc.up, tc.total, tc.expiry, "left@x").Error; err != nil { + t.Fatal(err) + } + header := tb.clientHeader("left@x") + for _, want := range tc.want { + if !strings.Contains(header, want) { + t.Errorf("header %q lacks %q", header, want) + } + } + for _, avoid := range tc.avoid { + if strings.Contains(header, avoid) { + t.Errorf("header %q shows %q", header, avoid) + } + } + }) + } +} + +// The pages a customer copies links from say what is left: the individual +// links through the header, the subscription through its owner's usage block. +func TestLinkPagesCarryTheHeader(t *testing.T) { + localizeWithRealBundle(t) + tb, _ := newScreenTgbot(t, false) + initReportDB(t) + setTestAdmins(t) + seedLinkedClient(t, 4242, "pages@x", "Alpha") + if err := database.GetDB().Exec("UPDATE client_traffics SET total = ? WHERE email = ?", int64(10<<30), "pages@x").Error; err != nil { + t.Fatal(err) + } + + for _, data := range []string{"client_sub_links pages@x", "client_individual_links pages@x"} { + tapClientLinks(t, tb, 4242, data) + sc, ok := tb.screens().get(4242) + if !ok || !strings.Contains(sc.body, "10.00GB") { + t.Errorf("%q drew no header with the quota left: %+v", data, sc) + } + } +} + +// I18nBot escapes its parameters, so the header hands it the raw email: an +// email with "&" must read as one &, not the &amp; of a second pass. +func TestClientHeaderEscapesTheEmailOnce(t *testing.T) { + localizeWithRealBundle(t) + tb, _ := newScreenTgbot(t, false) + initReportDB(t) + setTestAdmins(t) + seedClientForTgUser(t, 4242, "a&b@x") + + header := tb.clientHeader("a&b@x") + if !strings.Contains(header, "a&b@x") || strings.Contains(header, "&amp;") { + t.Errorf("header %q does not escape the email exactly once", header) + } +} diff --git a/internal/web/service/tgbot/screen_client_one_link.go b/internal/web/service/tgbot/screen_client_one_link.go new file mode 100644 index 000000000..f47ef9c74 --- /dev/null +++ b/internal/web/service/tgbot/screen_client_one_link.go @@ -0,0 +1,133 @@ +package tgbot + +import ( + "fmt" + "html" + "net/url" + "strconv" + "strings" + + "github.com/mhsanaei/3x-ui/v3/internal/util/link" + + "github.com/mymmrac/telego" + tu "github.com/mymmrac/telego/telegoutil" +) + +// The link's remark is the name the client app will show, so it is the label a +// customer recognises when picking one of several. +func linkLabel(shareLink string, index int) string { + fallback := fmt.Sprintf("Link %d", index+1) + if scheme, _, found := strings.Cut(shareLink, "://"); found && scheme != "" { + fallback = fmt.Sprintf("%d. %s", index+1, strings.ToUpper(scheme)) + } + remark := linkRemark(shareLink) + if remark == "" { + return fallback + } + return fmt.Sprintf("%d. %s", index+1, remark) +} + +// VMess keeps its remark as "ps" inside the base64 JSON; every other scheme +// carries it as the "#remark" fragment. +func linkRemark(shareLink string) string { + if strings.HasPrefix(shareLink, "vmess://") { + parsed, err := link.ParseLink(shareLink) + if err != nil { + return "" + } + tag, _ := parsed.Outbound["tag"].(string) + return strings.TrimSpace(tag) + } + hash := strings.LastIndex(shareLink, "#") + if hash < 0 || hash+1 >= len(shareLink) { + return "" + } + remark := strings.TrimSpace(shareLink[hash+1:]) + if decoded, err := url.QueryUnescape(remark); err == nil { + remark = strings.TrimSpace(decoded) + } + return remark +} + +// splitEmailIndex reads link_one's " ". The index is cut from the +// end, so an email holding a space still names the right client. +func splitEmailIndex(arg string) (string, int, bool) { + arg = strings.TrimSpace(arg) + cut := strings.LastIndex(arg, " ") + if cut <= 0 { + return "", 0, false + } + index, err := strconv.Atoi(arg[cut+1:]) + email := strings.TrimSpace(arg[:cut]) + if err != nil || index < 0 || email == "" { + return "", 0, false + } + return email, index, true +} + +// individualLinks returns the client's share links, built in-process for the +// host the subscription URL names, never by fetching that URL. +func (t *Tgbot) individualLinks(email string) ([]string, error) { + subURL, _, err := t.buildSubscriptionURLs(email) + if err != nil { + return nil, err + } + return t.clientSubLinks(email, subURL) +} + +// screenOneLinkPicker asks which link before showing one, so "Get one" on a +// client attached to six inbounds is not the same wall of links as "All". +func (t *Tgbot) screenOneLinkPicker(chatID int64, email string) { + links, err := t.individualLinks(email) + if err != nil { + t.sendNotice(chatID, t.I18nBot("tgbot.answers.errorOperation")) + return + } + if len(links) == 0 { + t.sendNotice(chatID, t.I18nBot("tgbot.noResult")) + return + } + if len(links) == 1 { + t.screenOneLink(chatID, email, 0) + return + } + rows := make([][]telego.InlineKeyboardButton, 0, len(links)+1) + for i, link := range links { + rows = append(rows, tu.InlineKeyboardRow( + t.btn2(linkLabel(link, i), t.encodeQuery(fmt.Sprintf("link_one %s %d", email, i))))) + } + rows = append(rows, tu.InlineKeyboardRow(t.btn("tgbot.buttons.links", t.encodeQuery("client_sub_links "+email)))) + t.renderScreen(chatID, t.newScreen("links", + t.clientHeader(email)+t.I18nBot("tgbot.messages.chooseOneConfig"), rows...)) +} + +// screenOneLink shows one link with its own QR as the picture. The list is read +// again rather than trusted from the button, so a stale tap cannot show a gone link. +func (t *Tgbot) screenOneLink(chatID int64, email string, index int) { + links, err := t.individualLinks(email) + if err != nil { + t.sendNotice(chatID, t.I18nBot("tgbot.answers.errorOperation")) + return + } + if index < 0 || index >= len(links) { + t.sendNotice(chatID, t.I18nBot("tgbot.noResult")) + return + } + link := links[index] + body := t.clientHeader(email) + html.EscapeString(linkLabel(link, index)) + + ":\r\n" + html.EscapeString(link) + "" + rows := [][]telego.InlineKeyboardButton{ + tu.InlineKeyboardRow( + t.btn("tgbot.buttons.getOneConfig", t.encodeQuery("client_one_link "+email)), + t.btn("tgbot.buttons.links", t.encodeQuery("client_sub_links "+email)), + ), + } + sc := t.newScreen("qr", body, rows...) + sc.qrPicture = qrSheetPicture([]subscriptionQRCode{{content: link, kind: "link", app: index + 1}}) + sc.qrSource = link + if sc.qrPicture == nil { + t.sendNotice(chatID, t.I18nBot("tgbot.answers.errorOperation")) + return + } + t.renderScreen(chatID, sc) +} diff --git a/internal/web/service/tgbot/screen_client_one_link_test.go b/internal/web/service/tgbot/screen_client_one_link_test.go new file mode 100644 index 000000000..3f4323249 --- /dev/null +++ b/internal/web/service/tgbot/screen_client_one_link_test.go @@ -0,0 +1,204 @@ +package tgbot + +import ( + "encoding/json" + "fmt" + "strings" + "testing" + + "github.com/mhsanaei/3x-ui/v3/internal/database" + "github.com/mhsanaei/3x-ui/v3/internal/database/model" + "github.com/mhsanaei/3x-ui/v3/internal/sub" + "github.com/mhsanaei/3x-ui/v3/internal/web/service" + "github.com/mhsanaei/3x-ui/v3/internal/xray" +) + +// seedLinkedClient binds email to tgID on one VLESS inbound per remark, with the +// real link provider, so the subscription yields one share link per inbound. +func seedLinkedClient(t *testing.T, tgID int64, email string, remarks ...string) { + t.Helper() + seedLinkedClientOn(t, model.VLESS, tgID, email, remarks...) +} + +func seedLinkedClientOn(t *testing.T, protocol model.Protocol, tgID int64, email string, remarks ...string) { + t.Helper() + service.RegisterSubLinkProvider(sub.NewLinkProvider()) + t.Cleanup(func() { service.RegisterSubLinkProvider(nil) }) + origHost := hostname + t.Cleanup(func() { hostname = origHost }) + hostname = "panel.invalid" + + const uuid = "11111111-2222-4333-8444-555555555555" + db := database.GetDB() + rec := &model.ClientRecord{Email: email, SubID: "sub-" + email, UUID: uuid, TgID: tgID, Enable: true} + if err := db.Create(rec).Error; err != nil { + t.Fatalf("seed client: %v", err) + } + for i, remark := range remarks { + ib := &model.Inbound{ + UserId: 1, Tag: fmt.Sprintf("one-%d", i), Enable: true, Listen: "203.0.113.5", Port: 4430 + i, + Protocol: protocol, Remark: remark, + Settings: fmt.Sprintf(`{"clients":[{"id":%q,"email":%q,"tgId":%d,"subId":%q,"enable":true}],"decryption":"none"}`, + uuid, email, tgID, rec.SubID), + } + if err := db.Create(ib).Error; err != nil { + t.Fatalf("seed inbound: %v", err) + } + if err := db.Create(&model.ClientInbound{ClientId: rec.Id, InboundId: ib.Id}).Error; err != nil { + t.Fatalf("seed client_inbound: %v", err) + } + if i == 0 { + if err := db.Create(&xray.ClientTraffic{InboundId: ib.Id, Email: email, Enable: true}).Error; err != nil { + t.Fatalf("seed traffic: %v", err) + } + } + } +} + +func screenMarkup(t *testing.T, tb *Tgbot, chatID int64) string { + t.Helper() + sc, ok := tb.screens().get(chatID) + if !ok { + t.Fatal("no screen was tracked") + } + markup, _ := json.Marshal(sc.markup) + return string(markup) +} + +// The label is what a customer picks from, so it comes from the link's own +// remark — the same name their client app will show for that server. +func TestLinkLabel(t *testing.T) { + tests := []struct { + name string + link string + index int + want string + }{ + {"remark fragment", "vless://uuid@host:443?type=tcp#Germany-Reality", 0, "1. Germany-Reality"}, + {"percent-encoded remark", "vless://uuid@host:443#Tokyo%20Node", 1, "2. Tokyo Node"}, + {"no fragment falls back to protocol", "trojan://pass@host:443", 2, "3. TROJAN"}, + {"empty fragment falls back", "vmess://payload#", 3, "4. VMESS"}, + {"blank fragment falls back", "ss://payload#%20", 4, "5. SS"}, + {"not a url at all", "garbage", 5, "Link 6"}, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + if got := linkLabel(tc.link, tc.index); got != tc.want { + t.Fatalf("linkLabel(%q, %d) = %q, want %q", tc.link, tc.index, got, tc.want) + } + }) + } +} + +// The index is callback data, so a malformed one must not reach a screen, and +// it must never be read as part of the client the ownership check verifies. +func TestSplitEmailIndex(t *testing.T) { + tests := []struct { + arg string + wantEmail string + wantIndex int + wantOK bool + }{ + {"alice@x 0", "alice@x", 0, true}, + {"alice@x 12", "alice@x", 12, true}, + {" alice@x 3 ", "alice@x", 3, true}, + {"two words 3", "two words", 3, true}, + {"alice@x", "", 0, false}, + {"alice@x abc", "", 0, false}, + {"alice@x -1", "", 0, false}, + {" 4", "", 0, false}, + {"", "", 0, false}, + } + for _, tc := range tests { + email, index, ok := splitEmailIndex(tc.arg) + if email != tc.wantEmail || index != tc.wantIndex || ok != tc.wantOK { + t.Errorf("splitEmailIndex(%q) = (%q, %d, %v), want (%q, %d, %v)", + tc.arg, email, index, ok, tc.wantEmail, tc.wantIndex, tc.wantOK) + } + } +} + +// "Get one" on a config attached to two inbounds offers each by the name its +// app will show, and the chosen one comes back with its own QR as the picture. +func TestGetOneOffersEachLinkAndShowsTheChosenOne(t *testing.T) { + tb, _ := newScreenTgbot(t, false) + initReportDB(t) + setTestAdmins(t) + seedLinkedClient(t, 4242, "pick@x", "Alpha", "Beta") + + tapClientLinks(t, tb, 4242, "client_one_link pick@x") + sc, ok := tb.screens().get(4242) + if !ok { + t.Fatal("the picker was not drawn") + } + var picked []string + for _, row := range sc.markup.InlineKeyboard { + for _, button := range row { + if strings.HasPrefix(button.CallbackData, "link_one pick@x ") { + picked = append(picked, button.Text+" → "+button.CallbackData) + } + } + } + if len(picked) != 2 || !strings.Contains(picked[0], "Alpha") || !strings.Contains(picked[1], "Beta") { + t.Fatalf("picker offers %v, want Alpha then Beta", picked) + } + + tapClientLinks(t, tb, 4242, "link_one pick@x 1") + sc, _ = tb.screens().get(4242) + if !strings.Contains(sc.qrSource, "vless://") || !strings.Contains(sc.qrSource, ":4431") { + t.Fatalf("the QR encodes %q, want Beta's link on port 4431", sc.qrSource) + } + if sc.qrPicture == nil || !strings.Contains(sc.body, "Beta") { + t.Errorf("the chosen link is not on the screen: body %q", sc.body) + } +} + +// VMess keeps its remark inside the base64 body, not after "#", so a picker that +// read only fragments listed every VMess inbound as the same "VMESS". +func TestGetOneNamesVMessLinksByTheirRemark(t *testing.T) { + tb, _ := newScreenTgbot(t, false) + initReportDB(t) + setTestAdmins(t) + seedLinkedClientOn(t, model.VMESS, 4242, "vm@x", "Alpha", "Beta") + + tapClientLinks(t, tb, 4242, "client_one_link vm@x") + sc, ok := tb.screens().get(4242) + if !ok { + t.Fatal("the picker was not drawn") + } + var labels []string + for _, row := range sc.markup.InlineKeyboard { + for _, button := range row { + if strings.HasPrefix(button.CallbackData, "link_one vm@x ") { + labels = append(labels, button.Text) + } + } + } + if len(labels) != 2 || !strings.Contains(labels[0], "Alpha") || !strings.Contains(labels[1], "Beta") { + t.Fatalf("picker offers %q, want Alpha then Beta", labels) + } +} + +// One link is nothing to choose from, so the picker opens it at once; a stale +// index from an inbound since removed is refused rather than shown. +func TestGetOneOpensASingleLinkAndRefusesAStaleIndex(t *testing.T) { + tb, calls := newScreenTgbot(t, false) + initReportDB(t) + setTestAdmins(t) + seedLinkedClient(t, 4242, "solo@x", "Only") + + tapClientLinks(t, tb, 4242, "client_one_link") + sc, ok := tb.screens().get(4242) + if !ok || !strings.Contains(sc.qrSource, ":4430") { + t.Fatalf("the single link did not open directly: %v", methods(calls())) + } + + before := len(calls()) + tapClientLinks(t, tb, 4242, "link_one solo@x 3") + if got := countMethod(calls()[before:], "sendMessage"); got != 1 { + t.Errorf("a stale index sent %v, want one notice", methods(calls()[before:])) + } + if sc, _ := tb.screens().get(4242); !strings.Contains(sc.qrSource, ":4430") { + t.Errorf("a stale index replaced the screen with %q", sc.qrSource) + } +} diff --git a/internal/web/service/tgbot/screen_client_views.go b/internal/web/service/tgbot/screen_client_views.go index 438e36a1c..abad3c514 100644 --- a/internal/web/service/tgbot/screen_client_views.go +++ b/internal/web/service/tgbot/screen_client_views.go @@ -175,7 +175,10 @@ func (t *Tgbot) screenClientLinks(chatID int64, email string) { body += t.I18nBot("tgbot.messages.refreshedOn", "Time=="+time.Now().Format("2006-01-02 15:04:05")) rows := [][]telego.InlineKeyboardButton{ tu.InlineKeyboardRow(t.btn("tgbot.buttons.individualLinks", t.encodeQuery("client_individual_links "+email))), - tu.InlineKeyboardRow(t.btn("tgbot.buttons.qrCode", t.encodeQuery("client_qr_links "+email))), + tu.InlineKeyboardRow( + t.btn("tgbot.buttons.getOneConfig", t.encodeQuery("client_one_link "+email)), + t.btn("tgbot.buttons.qrCode", t.encodeQuery("client_qr_links "+email)), + ), } // The client card is admin-only; a client's own usage is already above. if own == nil { @@ -200,7 +203,8 @@ func (t *Tgbot) screenIndividualLinks(chatID int64, email string) { return } var body strings.Builder - body.WriteString(t.clientScreenBody(email, t.I18nBot("tgbot.buttons.individualLinks"))) + body.WriteString(t.clientHeader(email)) + body.WriteString(html.EscapeString(t.I18nBot("tgbot.buttons.individualLinks")) + "\n\n") for _, link := range links { body.WriteString("" + html.EscapeString(link) + "\n") } @@ -388,5 +392,7 @@ func (t *Tgbot) openClientAction(chatID int64, action, email string) { t.screenIndividualLinks(chatID, email) case "client_qr_links": t.screenClientQR(chatID, email) + case "client_one_link": + t.screenOneLinkPicker(chatID, email) } } diff --git a/internal/web/service/tgbot/screen_views.go b/internal/web/service/tgbot/screen_views.go index 73e3f4fc0..6b857cf9c 100644 --- a/internal/web/service/tgbot/screen_views.go +++ b/internal/web/service/tgbot/screen_views.go @@ -48,16 +48,23 @@ func (t *Tgbot) screenClientHome(chatID, userID int64, delivery ...screenDeliver // one row each. Either way this is the client's top level, so no back button. var rows [][]telego.InlineKeyboardButton if len(traffics) == 1 { - rows = append(rows, tu.InlineKeyboardRow( - t.btn("tgbot.buttons.links", "client_sub_links"), - t.btn("tgbot.buttons.qrCode", "client_qr_links"), - )) + rows = append(rows, + tu.InlineKeyboardRow( + t.btn("tgbot.buttons.links", "client_sub_links"), + t.btn("tgbot.buttons.qrCode", "client_qr_links"), + ), + tu.InlineKeyboardRow( + t.btn("tgbot.buttons.getOneConfig", "client_one_link"), + t.btn("tgbot.buttons.setupGuide", cbClientGuide), + ), + ) } else { for _, traffic := range traffics { rows = append(rows, tu.InlineKeyboardRow( t.btn2(traffic.Email, t.encodeQuery("client_sub_links "+traffic.Email)), )) } + rows = append(rows, tu.InlineKeyboardRow(t.btn("tgbot.buttons.setupGuide", cbClientGuide))) } t.renderScreen(chatID, t.rootScreen("main", body.String(), rows...), delivery...) } diff --git a/internal/web/service/tgbot/screens_art.go b/internal/web/service/tgbot/screens_art.go index 3312267a3..e108df8c2 100644 --- a/internal/web/service/tgbot/screens_art.go +++ b/internal/web/service/tgbot/screens_art.go @@ -207,5 +207,5 @@ func resetScreenArt() { // same avatar, but the names keep each screen's intent visible in the code. var screenKinds = []string{ "main", "status", "inbounds", "clients", "client", "links", "qr", - "wizard", "reports", "backup", "onlines", "deplete", "commands", "broadcast", + "wizard", "reports", "backup", "onlines", "deplete", "commands", "broadcast", "guide", } diff --git a/internal/web/service/tgbot/tgbot_client_links_authz_test.go b/internal/web/service/tgbot/tgbot_client_links_authz_test.go index b0e37563e..795984ff2 100644 --- a/internal/web/service/tgbot/tgbot_client_links_authz_test.go +++ b/internal/web/service/tgbot/tgbot_client_links_authz_test.go @@ -156,3 +156,26 @@ func TestHashedLinkCallbackServesOwnClient(t *testing.T) { t.Errorf("message calls = %d, want 1: the owner's hashed button must still be served", n) } } + +// Every per-client link action names its target in the button, so each must +// refuse another customer's client before it draws anything. +func TestEveryClientLinkActionRefusesAForeignClient(t *testing.T) { + for _, action := range clientLinkActions { + t.Run(action, func(t *testing.T) { + tb, calls := newLinksCallbackTgbot(t, ownerMail) + data := action + " someone-else@x" + if action == "link_one" { + data += " 0" + } + + tapClientLinks(t, tb, ownerTgID, data) + + if n := calls("sendMessage") + calls("sendPhoto"); n != 0 { + t.Errorf("%q drew %d message(s) for a foreign client", data, n) + } + if n := calls("answerCallbackQuery"); n != 1 { + t.Errorf("%q answered %d time(s), want the refusal", data, n) + } + }) + } +} diff --git a/internal/web/service/tgbot/tgbot_router.go b/internal/web/service/tgbot/tgbot_router.go index 1c65523cd..788793124 100644 --- a/internal/web/service/tgbot/tgbot_router.go +++ b/internal/web/service/tgbot/tgbot_router.go @@ -425,6 +425,19 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool case "client_qr_links": t.screenClientQR(chatId, email) return + case "client_one_link": + t.answerSilent(callbackQuery.ID) + t.screenOneLinkPicker(chatId, email) + return + case "link_one": + _, target, index, ok := splitClientLinkCallback(decodedQuery) + if !ok { + t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.answers.errorOperation")) + return + } + t.answerSilent(callbackQuery.ID) + t.screenOneLink(chatId, target, index) + return case "client_get_usage": t.sendCallbackAnswerTgBot(callbackQuery.ID, t.I18nBot("tgbot.messages.email", "Email=="+email)) t.searchClientScreen(chatId, email) @@ -1031,10 +1044,13 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool case "client_traffic": t.answerSilent(callbackQuery.ID) t.getClientUsage(chatId, callbackQuery.From.ID, screenEditOrReplace) - case "client_sub_links", "client_individual_links", "client_qr_links": + case "client_sub_links", "client_individual_links", "client_qr_links", "client_one_link": // A client tapped its own link button: its identity already says which // subscription, so it opens directly. A second one still needs a choice. t.openOwnClientScreen(chatId, callbackQuery.From.ID, callbackQuery.Data) + case cbClientGuide: + t.answerSilent(callbackQuery.ID) + t.screenGuide(chatId, "") case "add_client_ch_default_email": userStateMgr.set(actor, "awaiting_email") t.wizardPrompt(chatId, draft, t.I18nBot("tgbot.messages.email_prompt", "ClientEmail=="+draft.email)) @@ -1205,7 +1221,12 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool // only button being the one just pressed. t.screenHome(chatId, callbackQuery.From.ID) default: - action, email, ok := splitClientLinkCallback(callbackQuery.Data) + if messageKey, ok := parseGuideCallback(callbackQuery.Data); ok { + t.answerSilent(callbackQuery.ID) + t.screenGuide(chatId, messageKey) + return + } + action, email, index, ok := splitClientLinkCallback(callbackQuery.Data) if !ok { // Nothing matched: an unknown button still has to be answered, or it // keeps spinning until Telegram times the callback out. @@ -1225,6 +1246,12 @@ func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool t.screenIndividualLinks(chatId, email) case "client_qr_links": t.screenClientQR(chatId, email) + case "client_one_link": + t.answerSilent(callbackQuery.ID) + t.screenOneLinkPicker(chatId, email) + case "link_one": + t.answerSilent(callbackQuery.ID) + t.screenOneLink(chatId, email, index) } } } @@ -1241,25 +1268,38 @@ func isClientSelfCallback(data string) bool { // "hide" is how any recipient puts a message away: it carries no target of its // own (it is the message it sits on), so it is safe for anyone to reach. case "home", "hide", "client_traffic", "client_commands", "client_sub_links", - "client_individual_links", "client_qr_links": + "client_individual_links", "client_qr_links", "client_one_link", cbClientGuide: return true // Paging only turns the screen already tracked for the caller's own chat. case cbPageNext, cbPagePrev, cbPageNone: return true } - _, _, ok := splitClientLinkCallback(data) + if _, ok := parseGuideCallback(data); ok { + return true + } + _, _, _, ok := splitClientLinkCallback(data) return ok } +// clientLinkActions are the callbacks that name one client, so each must pass +// the ownership check before a customer is served. +var clientLinkActions = []string{"client_sub_links", "client_individual_links", "client_qr_links", "client_one_link", "link_one"} + // splitClientLinkCallback splits " " for the per-client link -// callbacks; ok is false for every other data. -func splitClientLinkCallback(data string) (action, email string, ok bool) { - for _, candidate := range []string{"client_sub_links", "client_individual_links", "client_qr_links"} { - if rest, found := strings.CutPrefix(data, candidate+" "); found && rest != "" { - return candidate, rest, true +// callbacks; link_one also carries the link's index, which is never the client. +func splitClientLinkCallback(data string) (action, email string, index int, ok bool) { + for _, candidate := range clientLinkActions { + rest, found := strings.CutPrefix(data, candidate+" ") + if !found || rest == "" { + continue } + if candidate == "link_one" { + email, index, ok = splitEmailIndex(rest) + return candidate, email, index, ok + } + return candidate, rest, 0, true } - return "", "", false + return "", "", 0, false } // refuseGroups keeps every update in a private chat: a group shares one screen and keyboard among its diff --git a/internal/web/translation/ar-EG.json b/internal/web/translation/ar-EG.json index f3ea3a8fd..d3dea20fc 100644 --- a/internal/web/translation/ar-EG.json +++ b/internal/web/translation/ar-EG.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. اشتراك JSON", "qrLegendLink": "{{ .Code }}. رابط التطبيق {{ .App }}", "backupFailed": "فشل قراءة قاعدة البيانات؛ لم يُرسل أي نسخة احتياطية.", - "privateOnly": "🤖 يعمل هذا البوت في المحادثة الخاصة فقط. يرجى فتحه في رسالة مباشرة." + "privateOnly": "🤖 يعمل هذا البوت في المحادثة الخاصة فقط. يرجى فتحه في رسالة مباشرة.", + "chooseOneConfig": "👇 أي إعداد تريد؟", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 دليل الإعداد\nاختر الجهاز الذي تريد إعداده.", + "guideIos": "🍎 آيفون / آيباد\n1. ثبّت Streisand أو V2Box من App Store.\n2. افتح صفحة روابط الاشتراك في هذا البوت وانسخ رابط اشتراكك.\n3. في التطبيق اضغط + ثم Add from clipboard.\n4. اسحب للأسفل للتحديث ثم اتصل.", + "guideAndroid": "🤖 أندرويد\n1. ثبّت v2rayNG أو Hiddify من Google Play.\n2. افتح صفحة روابط الاشتراك في هذا البوت وانسخ رابط اشتراكك.\n3. في التطبيق اضغط + ثم Import from clipboard.\n4. حدّث الاشتراك واختر خادمًا ثم اتصل.", + "guideWindows": "🪟 ويندوز\n1. ثبّت Hiddify أو v2rayN.\n2. افتح صفحة روابط الاشتراك في هذا البوت وانسخ رابط اشتراكك.\n3. في التطبيق أضف اشتراكًا والصق الرابط.\n4. حدّث الاشتراك واختر خادمًا ثم اتصل.", + "guideMacos": "💻 ماك\n1. ثبّت Hiddify أو V2Box.\n2. افتح صفحة روابط الاشتراك في هذا البوت وانسخ رابط اشتراكك.\n3. في التطبيق أضف اشتراكًا والصق الرابط.\n4. حدّث الاشتراك واختر خادمًا ثم اتصل.", + "guideLinux": "🐧 لينكس\n1. ثبّت Hiddify (AppImage) أو Nekoray.\n2. افتح صفحة روابط الاشتراك في هذا البوت وانسخ رابط اشتراكك.\n3. في التطبيق أضف اشتراكًا والصق الرابط.\n4. حدّث الاشتراك واختر خادمًا ثم اتصل." }, "buttons": { "closeKeyboard": "❌ اقفل الكيبورد", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 بث", "attachInbound": "إرفاق مدخل ({{ .Count }})", - "attachDone": "✅ تم" + "attachDone": "✅ تم", + "getOneConfig": "🎯 الحصول على واحد", + "setupGuide": "📖 دليل الإعداد", + "guideIos": "🍎 آيفون / آيباد", + "guideAndroid": "🤖 أندرويد", + "guideWindows": "🪟 ويندوز", + "guideMacos": "💻 ماك", + "guideLinux": "🐧 لينكس" }, "answers": { "broadcastStarted": "🚀 بدأ البث.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "دليل الإعداد" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/en-US.json b/internal/web/translation/en-US.json index 8c3ce3b6d..589ea07f5 100644 --- a/internal/web/translation/en-US.json +++ b/internal/web/translation/en-US.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. JSON subscription", "qrLegendLink": "{{ .Code }}. App link {{ .App }}", "backupFailed": "Could not read the database; no backup was sent.", - "privateOnly": "🤖 This bot works in private chat only. Please open it in a direct message." + "privateOnly": "🤖 This bot works in private chat only. Please open it in a direct message.", + "chooseOneConfig": "👇 Which config do you want?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Setup guide\nPick the device you want to set up.", + "guideIos": "🍎 iPhone / iPad\n1. Install Streisand or V2Box from the App Store.\n2. Open the Subscription links page in this bot and copy your subscription URL.\n3. In the app, tap + → Add from clipboard.\n4. Pull down to update, then connect.", + "guideAndroid": "🤖 Android\n1. Install v2rayNG or Hiddify from Google Play.\n2. Open the Subscription links page in this bot and copy your subscription URL.\n3. In the app, tap + → Import from clipboard.\n4. Refresh the subscription, pick a server and connect.", + "guideWindows": "🪟 Windows\n1. Install Hiddify or v2rayN.\n2. Open the Subscription links page in this bot and copy your subscription URL.\n3. In the app, add a subscription and paste the URL.\n4. Update the subscription, pick a server and connect.", + "guideMacos": "💻 macOS\n1. Install Hiddify or V2Box.\n2. Open the Subscription links page in this bot and copy your subscription URL.\n3. In the app, add a subscription and paste the URL.\n4. Update the subscription, pick a server and connect.", + "guideLinux": "🐧 Linux\n1. Install Hiddify (AppImage) or Nekoray.\n2. Open the Subscription links page in this bot and copy your subscription URL.\n3. In the app, add a subscription and paste the URL.\n4. Update the subscription, pick a server and connect." }, "buttons": { "closeKeyboard": "❌ Close Keyboard", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Broadcast", "attachInbound": "Attach inbound ({{ .Count }})", - "attachDone": "✅ Done" + "attachDone": "✅ Done", + "getOneConfig": "🎯 Get one", + "setupGuide": "📖 Setup guide", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Broadcast started.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Setup guide" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/es-ES.json b/internal/web/translation/es-ES.json index 1a78512f7..24379b9a2 100644 --- a/internal/web/translation/es-ES.json +++ b/internal/web/translation/es-ES.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. Suscripción JSON", "qrLegendLink": "{{ .Code }}. Enlace de la app {{ .App }}", "backupFailed": "No se pudo leer la base de datos; no se envió ninguna copia de seguridad.", - "privateOnly": "🤖 Este bot solo funciona en el chat privado. Ábrelo en un mensaje directo." + "privateOnly": "🤖 Este bot solo funciona en el chat privado. Ábrelo en un mensaje directo.", + "chooseOneConfig": "👇 ¿Qué config quieres?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Guía de instalación\nElige el dispositivo que quieres configurar.", + "guideIos": "🍎 iPhone / iPad\n1. Instala Streisand o V2Box desde la App Store.\n2. Abre la página de enlaces de suscripción en este bot y copia tu URL.\n3. En la app, pulsa + → Add from clipboard.\n4. Desliza hacia abajo para actualizar y conéctate.", + "guideAndroid": "🤖 Android\n1. Instala v2rayNG o Hiddify desde Google Play.\n2. Abre la página de enlaces de suscripción en este bot y copia tu URL.\n3. En la app, pulsa + → Import from clipboard.\n4. Actualiza la suscripción, elige un servidor y conéctate.", + "guideWindows": "🪟 Windows\n1. Instala Hiddify o v2rayN.\n2. Abre la página de enlaces de suscripción en este bot y copia tu URL.\n3. En la app, añade una suscripción y pega la URL.\n4. Actualiza la suscripción, elige un servidor y conéctate.", + "guideMacos": "💻 macOS\n1. Instala Hiddify o V2Box.\n2. Abre la página de enlaces de suscripción en este bot y copia tu URL.\n3. En la app, añade una suscripción y pega la URL.\n4. Actualiza la suscripción, elige un servidor y conéctate.", + "guideLinux": "🐧 Linux\n1. Instala Hiddify (AppImage) o Nekoray.\n2. Abre la página de enlaces de suscripción en este bot y copia tu URL.\n3. En la app, añade una suscripción y pega la URL.\n4. Actualiza la suscripción, elige un servidor y conéctate." }, "buttons": { "closeKeyboard": "❌ Cerrar Teclado", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Difusión", "attachInbound": "Adjuntar entrada ({{ .Count }})", - "attachDone": "✅ Listo" + "attachDone": "✅ Listo", + "getOneConfig": "🎯 Obtener uno", + "setupGuide": "📖 Guía de instalación", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Difusión iniciada.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Guía de instalación" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/fa-IR.json b/internal/web/translation/fa-IR.json index 399306b26..300a7bc47 100644 --- a/internal/web/translation/fa-IR.json +++ b/internal/web/translation/fa-IR.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. اشتراک JSON", "qrLegendLink": "{{ .Code }}. لینک برنامه {{ .App }}", "backupFailed": "خواندن پایگاه داده ممکن نشد؛ هیچ نسخه پشتیبانی ارسال نشد.", - "privateOnly": "🤖 این ربات فقط در چت خصوصی کار میکند. لطفاً آن را در پیام مستقیم باز کنید." + "privateOnly": "🤖 این ربات فقط در چت خصوصی کار میکند. لطفاً آن را در پیام مستقیم باز کنید.", + "chooseOneConfig": "👇 کدام کانفیگ را می‌خواهید؟", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 راهنمای نصب\nدستگاهی را که می‌خواهید تنظیم کنید انتخاب کنید.", + "guideIos": "🍎 آیفون / آیپد\n۱. برنامه Streisand یا V2Box را از App Store نصب کنید.\n۲. در همین ربات صفحه لینک‌های اشتراک را باز کنید و آدرس اشتراک خود را کپی کنید.\n۳. در برنامه روی + و سپس Add from clipboard بزنید.\n۴. صفحه را به پایین بکشید تا به‌روزرسانی شود، سپس متصل شوید.", + "guideAndroid": "🤖 اندروید\n۱. برنامه v2rayNG یا Hiddify را از گوگل‌پلی نصب کنید.\n۲. در همین ربات صفحه لینک‌های اشتراک را باز کنید و آدرس اشتراک خود را کپی کنید.\n۳. در برنامه روی + و سپس Import from clipboard بزنید.\n۴. اشتراک را به‌روزرسانی کنید، یک سرور انتخاب کنید و متصل شوید.", + "guideWindows": "🪟 ویندوز\n۱. برنامه Hiddify یا v2rayN را نصب کنید.\n۲. در همین ربات صفحه لینک‌های اشتراک را باز کنید و آدرس اشتراک خود را کپی کنید.\n۳. در برنامه یک اشتراک اضافه کنید و آدرس را جای‌گذاری کنید.\n۴. اشتراک را به‌روزرسانی کنید، یک سرور انتخاب کنید و متصل شوید.", + "guideMacos": "💻 مک\n۱. برنامه Hiddify یا V2Box را نصب کنید.\n۲. در همین ربات صفحه لینک‌های اشتراک را باز کنید و آدرس اشتراک خود را کپی کنید.\n۳. در برنامه یک اشتراک اضافه کنید و آدرس را جای‌گذاری کنید.\n۴. اشتراک را به‌روزرسانی کنید، یک سرور انتخاب کنید و متصل شوید.", + "guideLinux": "🐧 لینوکس\n۱. برنامه Hiddify (AppImage) یا Nekoray را نصب کنید.\n۲. در همین ربات صفحه لینک‌های اشتراک را باز کنید و آدرس اشتراک خود را کپی کنید.\n۳. در برنامه یک اشتراک اضافه کنید و آدرس را جای‌گذاری کنید.\n۴. اشتراک را به‌روزرسانی کنید، یک سرور انتخاب کنید و متصل شوید." }, "buttons": { "closeKeyboard": "❌ بستن کیبورد", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 همگانی", "attachInbound": "افزودن ورودی ({{ .Count }})", - "attachDone": "✅ انجام شد" + "attachDone": "✅ انجام شد", + "getOneConfig": "🎯 دریافت یکی", + "setupGuide": "📖 راهنمای نصب", + "guideIos": "🍎 آیفون / آیپد", + "guideAndroid": "🤖 اندروید", + "guideWindows": "🪟 ویندوز", + "guideMacos": "💻 مک", + "guideLinux": "🐧 لینوکس" }, "answers": { "broadcastStarted": "🚀 ارسال گروهی آغاز شد.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "راهنمای نصب" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/id-ID.json b/internal/web/translation/id-ID.json index cf767d3e1..73158bdc0 100644 --- a/internal/web/translation/id-ID.json +++ b/internal/web/translation/id-ID.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. Langganan JSON", "qrLegendLink": "{{ .Code }}. Tautan aplikasi {{ .App }}", "backupFailed": "Tidak dapat membaca basis data; tidak ada cadangan yang dikirim.", - "privateOnly": "🤖 Bot ini hanya berfungsi di obrolan pribadi. Silakan buka di pesan langsung." + "privateOnly": "🤖 Bot ini hanya berfungsi di obrolan pribadi. Silakan buka di pesan langsung.", + "chooseOneConfig": "👇 Konfigurasi mana yang Anda inginkan?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Panduan pemasangan\nPilih perangkat yang ingin Anda atur.", + "guideIos": "🍎 iPhone / iPad\n1. Pasang Streisand atau V2Box dari App Store.\n2. Buka halaman tautan langganan di bot ini dan salin URL langganan Anda.\n3. Di aplikasi, ketuk + → Add from clipboard.\n4. Tarik ke bawah untuk memperbarui, lalu sambungkan.", + "guideAndroid": "🤖 Android\n1. Pasang v2rayNG atau Hiddify dari Google Play.\n2. Buka halaman tautan langganan di bot ini dan salin URL langganan Anda.\n3. Di aplikasi, ketuk + → Import from clipboard.\n4. Segarkan langganan, pilih server, lalu sambungkan.", + "guideWindows": "🪟 Windows\n1. Pasang Hiddify atau v2rayN.\n2. Buka halaman tautan langganan di bot ini dan salin URL langganan Anda.\n3. Di aplikasi, tambahkan langganan dan tempel URL-nya.\n4. Perbarui langganan, pilih server, lalu sambungkan.", + "guideMacos": "💻 macOS\n1. Pasang Hiddify atau V2Box.\n2. Buka halaman tautan langganan di bot ini dan salin URL langganan Anda.\n3. Di aplikasi, tambahkan langganan dan tempel URL-nya.\n4. Perbarui langganan, pilih server, lalu sambungkan.", + "guideLinux": "🐧 Linux\n1. Pasang Hiddify (AppImage) atau Nekoray.\n2. Buka halaman tautan langganan di bot ini dan salin URL langganan Anda.\n3. Di aplikasi, tambahkan langganan dan tempel URL-nya.\n4. Perbarui langganan, pilih server, lalu sambungkan." }, "buttons": { "closeKeyboard": "❌ Tutup Papan Ketik", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Siaran", "attachInbound": "Lampirkan inbound ({{ .Count }})", - "attachDone": "✅ Selesai" + "attachDone": "✅ Selesai", + "getOneConfig": "🎯 Ambil satu", + "setupGuide": "📖 Panduan pemasangan", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Siaran dimulai.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Panduan pemasangan" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/ja-JP.json b/internal/web/translation/ja-JP.json index 2a562f083..67ca30ba9 100644 --- a/internal/web/translation/ja-JP.json +++ b/internal/web/translation/ja-JP.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. JSON サブスクリプション", "qrLegendLink": "{{ .Code }}. アプリのリンク {{ .App }}", "backupFailed": "データベースを読み取れませんでした。バックアップは送信されていません。", - "privateOnly": "🤖 このボットは個人チャットでのみ動作します。ダイレクトメッセージで開いてください。" + "privateOnly": "🤖 このボットは個人チャットでのみ動作します。ダイレクトメッセージで開いてください。", + "chooseOneConfig": "👇 どの設定が必要ですか?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 設定ガイド\n設定したい端末を選んでください。", + "guideIos": "🍎 iPhone / iPad\n1. App Store から Streisand または V2Box をインストールします。\n2. このボットの購読リンクのページを開き、購読 URL をコピーします。\n3. アプリで + → Add from clipboard をタップします。\n4. 下に引いて更新し、接続します。", + "guideAndroid": "🤖 Android\n1. Google Play から v2rayNG または Hiddify をインストールします。\n2. このボットの購読リンクのページを開き、購読 URL をコピーします。\n3. アプリで + → Import from clipboard をタップします。\n4. 購読を更新し、サーバーを選んで接続します。", + "guideWindows": "🪟 Windows\n1. Hiddify または v2rayN をインストールします。\n2. このボットの購読リンクのページを開き、購読 URL をコピーします。\n3. アプリで購読を追加し、URL を貼り付けます。\n4. 購読を更新し、サーバーを選んで接続します。", + "guideMacos": "💻 macOS\n1. Hiddify または V2Box をインストールします。\n2. このボットの購読リンクのページを開き、購読 URL をコピーします。\n3. アプリで購読を追加し、URL を貼り付けます。\n4. 購読を更新し、サーバーを選んで接続します。", + "guideLinux": "🐧 Linux\n1. Hiddify (AppImage) または Nekoray をインストールします。\n2. このボットの購読リンクのページを開き、購読 URL をコピーします。\n3. アプリで購読を追加し、URL を貼り付けます。\n4. 購読を更新し、サーバーを選んで接続します。" }, "buttons": { "closeKeyboard": "❌ キーボードを閉じる", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 一斉送信", "attachInbound": "インバウンドを追加 ({{ .Count }})", - "attachDone": "✅ 完了" + "attachDone": "✅ 完了", + "getOneConfig": "🎯 1つ取得", + "setupGuide": "📖 設定ガイド", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 一括送信を開始しました。", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "設定ガイド" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/pt-BR.json b/internal/web/translation/pt-BR.json index c033f943d..42b5c4dc0 100644 --- a/internal/web/translation/pt-BR.json +++ b/internal/web/translation/pt-BR.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. Assinatura JSON", "qrLegendLink": "{{ .Code }}. Link do app {{ .App }}", "backupFailed": "Não foi possível ler o banco de dados; nenhum backup foi enviado.", - "privateOnly": "🤖 Este bot funciona apenas no chat privado. Abra-o em uma mensagem direta." + "privateOnly": "🤖 Este bot funciona apenas no chat privado. Abra-o em uma mensagem direta.", + "chooseOneConfig": "👇 Qual config você quer?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Guia de instalação\nEscolha o dispositivo que quer configurar.", + "guideIos": "🍎 iPhone / iPad\n1. Instale Streisand ou V2Box pela App Store.\n2. Abra a página de links de assinatura neste bot e copie sua URL.\n3. No app, toque em + → Add from clipboard.\n4. Puxe para baixo para atualizar e conecte.", + "guideAndroid": "🤖 Android\n1. Instale v2rayNG ou Hiddify pelo Google Play.\n2. Abra a página de links de assinatura neste bot e copie sua URL.\n3. No app, toque em + → Import from clipboard.\n4. Atualize a assinatura, escolha um servidor e conecte.", + "guideWindows": "🪟 Windows\n1. Instale Hiddify ou v2rayN.\n2. Abra a página de links de assinatura neste bot e copie sua URL.\n3. No app, adicione uma assinatura e cole a URL.\n4. Atualize a assinatura, escolha um servidor e conecte.", + "guideMacos": "💻 macOS\n1. Instale Hiddify ou V2Box.\n2. Abra a página de links de assinatura neste bot e copie sua URL.\n3. No app, adicione uma assinatura e cole a URL.\n4. Atualize a assinatura, escolha um servidor e conecte.", + "guideLinux": "🐧 Linux\n1. Instale Hiddify (AppImage) ou Nekoray.\n2. Abra a página de links de assinatura neste bot e copie sua URL.\n3. No app, adicione uma assinatura e cole a URL.\n4. Atualize a assinatura, escolha um servidor e conecte." }, "buttons": { "closeKeyboard": "❌ Fechar teclado", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Transmissão", "attachInbound": "Anexar inbound ({{ .Count }})", - "attachDone": "✅ Concluído" + "attachDone": "✅ Concluído", + "getOneConfig": "🎯 Obter um", + "setupGuide": "📖 Guia de instalação", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Transmissão iniciada.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Guia de instalação" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/ru-RU.json b/internal/web/translation/ru-RU.json index eeb61cb4f..aa7220d2e 100644 --- a/internal/web/translation/ru-RU.json +++ b/internal/web/translation/ru-RU.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. JSON-подписка", "qrLegendLink": "{{ .Code }}. Ссылка для приложения {{ .App }}", "backupFailed": "Не удалось прочитать базу данных; бэкап не отправлен.", - "privateOnly": "🤖 Бот работает только в личных сообщениях. Открой его в личке." + "privateOnly": "🤖 Бот работает только в личных сообщениях. Открой его в личке.", + "chooseOneConfig": "👇 Какой конфиг вам нужен?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Инструкция по настройке\nВыберите устройство.", + "guideIos": "🍎 iPhone / iPad\n1. Установите Streisand или V2Box из App Store.\n2. Откройте страницу ссылок подписки в этом боте и скопируйте свою ссылку.\n3. В приложении нажмите + → Add from clipboard.\n4. Потяните вниз для обновления и подключайтесь.", + "guideAndroid": "🤖 Android\n1. Установите v2rayNG или Hiddify из Google Play.\n2. Откройте страницу ссылок подписки в этом боте и скопируйте свою ссылку.\n3. В приложении нажмите + → Import from clipboard.\n4. Обновите подписку, выберите сервер и подключитесь.", + "guideWindows": "🪟 Windows\n1. Установите Hiddify или v2rayN.\n2. Откройте страницу ссылок подписки в этом боте и скопируйте свою ссылку.\n3. В приложении добавьте подписку и вставьте ссылку.\n4. Обновите подписку, выберите сервер и подключитесь.", + "guideMacos": "💻 macOS\n1. Установите Hiddify или V2Box.\n2. Откройте страницу ссылок подписки в этом боте и скопируйте свою ссылку.\n3. В приложении добавьте подписку и вставьте ссылку.\n4. Обновите подписку, выберите сервер и подключитесь.", + "guideLinux": "🐧 Linux\n1. Установите Hiddify (AppImage) или Nekoray.\n2. Откройте страницу ссылок подписки в этом боте и скопируйте свою ссылку.\n3. В приложении добавьте подписку и вставьте ссылку.\n4. Обновите подписку, выберите сервер и подключитесь." }, "buttons": { "closeKeyboard": "❌ Закрыть клавиатуру", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Рассылка", "attachInbound": "Привязать инбаунд ({{ .Count }})", - "attachDone": "✅ Готово" + "attachDone": "✅ Готово", + "getOneConfig": "🎯 Получить один", + "setupGuide": "📖 Инструкция", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Рассылка запущена.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Инструкция" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/sk-SK.json b/internal/web/translation/sk-SK.json index 9779bef51..ddd43e858 100644 --- a/internal/web/translation/sk-SK.json +++ b/internal/web/translation/sk-SK.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. Predplatné JSON", "qrLegendLink": "{{ .Code }}. Odkaz pre aplikáciu {{ .App }}", "backupFailed": "Databázu sa nepodarilo prečítať; záloha nebola odoslaná.", - "privateOnly": "🤖 Tento bot funguje len v súkromnom chate. Otvorte ho, prosím, v priamej správe." + "privateOnly": "🤖 Tento bot funguje len v súkromnom chate. Otvorte ho, prosím, v priamej správe.", + "chooseOneConfig": "👇 Ktorú konfiguráciu chcete?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Návod na nastavenie\nVyberte zariadenie, ktoré chcete nastaviť.", + "guideIos": "🍎 iPhone / iPad\n1. Z App Store si nainštalujte Streisand alebo V2Box.\n2. Otvorte v tomto bote stránku s odkazmi na predplatné a skopírujte URL svojho predplatného.\n3. V aplikácii ťuknite na + → Add from clipboard.\n4. Potiahnutím nadol aktualizujte a pripojte sa.", + "guideAndroid": "🤖 Android\n1. Z Google Play si nainštalujte v2rayNG alebo Hiddify.\n2. Otvorte v tomto bote stránku s odkazmi na predplatné a skopírujte URL svojho predplatného.\n3. V aplikácii ťuknite na + → Import from clipboard.\n4. Aktualizujte predplatné, vyberte server a pripojte sa.", + "guideWindows": "🪟 Windows\n1. Nainštalujte si Hiddify alebo v2rayN.\n2. Otvorte v tomto bote stránku s odkazmi na predplatné a skopírujte URL svojho predplatného.\n3. V aplikácii pridajte predplatné a vložte URL.\n4. Aktualizujte predplatné, vyberte server a pripojte sa.", + "guideMacos": "💻 macOS\n1. Nainštalujte si Hiddify alebo V2Box.\n2. Otvorte v tomto bote stránku s odkazmi na predplatné a skopírujte URL svojho predplatného.\n3. V aplikácii pridajte predplatné a vložte URL.\n4. Aktualizujte predplatné, vyberte server a pripojte sa.", + "guideLinux": "🐧 Linux\n1. Nainštalujte si Hiddify (AppImage) alebo Nekoray.\n2. Otvorte v tomto bote stránku s odkazmi na predplatné a skopírujte URL svojho predplatného.\n3. V aplikácii pridajte predplatné a vložte URL.\n4. Aktualizujte predplatné, vyberte server a pripojte sa." }, "buttons": { "closeKeyboard": "❌ Zavrieť klávesnicu", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR kód", "broadcast": "📢 Hromadná správa", "attachInbound": "Pripojiť inbound ({{ .Count }})", - "attachDone": "✅ Hotovo" + "attachDone": "✅ Hotovo", + "getOneConfig": "🎯 Získať jeden", + "setupGuide": "📖 Návod na nastavenie", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Hromadné odosielanie sa začalo.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Dochádza", "commands": "Príkazy", - "broadcast": "Hromadná správa" + "broadcast": "Hromadná správa", + "guide": "Návod na nastavenie" }, "inline": { "noneTitle": "Nič sa nenašlo", diff --git a/internal/web/translation/tr-TR.json b/internal/web/translation/tr-TR.json index a123a4a30..5cac2e08d 100644 --- a/internal/web/translation/tr-TR.json +++ b/internal/web/translation/tr-TR.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. JSON abonelik", "qrLegendLink": "{{ .Code }}. Uygulama bağlantısı {{ .App }}", "backupFailed": "Veritabanı okunamadı; yedek gönderilmedi.", - "privateOnly": "🤖 Bu bot yalnızca özel sohbette çalışır. Lütfen doğrudan mesajda açın." + "privateOnly": "🤖 Bu bot yalnızca özel sohbette çalışır. Lütfen doğrudan mesajda açın.", + "chooseOneConfig": "👇 Hangi yapılandırmayı istiyorsunuz?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Kurulum rehberi\nKurmak istediğiniz cihazı seçin.", + "guideIos": "🍎 iPhone / iPad\n1. App Store'dan Streisand veya V2Box kurun.\n2. Bu botta Abonelik bağlantıları sayfasını açıp abonelik adresinizi kopyalayın.\n3. Uygulamada + → Add from clipboard dokunun.\n4. Güncellemek için aşağı çekin, sonra bağlanın.", + "guideAndroid": "🤖 Android\n1. Google Play'den v2rayNG veya Hiddify kurun.\n2. Bu botta Abonelik bağlantıları sayfasını açıp abonelik adresinizi kopyalayın.\n3. Uygulamada + → Import from clipboard dokunun.\n4. Aboneliği yenileyin, bir sunucu seçip bağlanın.", + "guideWindows": "🪟 Windows\n1. Hiddify veya v2rayN kurun.\n2. Bu botta Abonelik bağlantıları sayfasını açıp abonelik adresinizi kopyalayın.\n3. Uygulamada bir abonelik ekleyip adresi yapıştırın.\n4. Aboneliği güncelleyin, bir sunucu seçip bağlanın.", + "guideMacos": "💻 macOS\n1. Hiddify veya V2Box kurun.\n2. Bu botta Abonelik bağlantıları sayfasını açıp abonelik adresinizi kopyalayın.\n3. Uygulamada bir abonelik ekleyip adresi yapıştırın.\n4. Aboneliği güncelleyin, bir sunucu seçip bağlanın.", + "guideLinux": "🐧 Linux\n1. Hiddify (AppImage) veya Nekoray kurun.\n2. Bu botta Abonelik bağlantıları sayfasını açıp abonelik adresinizi kopyalayın.\n3. Uygulamada bir abonelik ekleyip adresi yapıştırın.\n4. Aboneliği güncelleyin, bir sunucu seçip bağlanın." }, "buttons": { "closeKeyboard": "❌ Klavyeyi Kapat", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Yayın", "attachInbound": "Inbound ekle ({{ .Count }})", - "attachDone": "✅ Tamam" + "attachDone": "✅ Tamam", + "getOneConfig": "🎯 Birini al", + "setupGuide": "📖 Kurulum rehberi", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Toplu gönderim başladı.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Kurulum rehberi" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/uk-UA.json b/internal/web/translation/uk-UA.json index 5d3b75897..259be8239 100644 --- a/internal/web/translation/uk-UA.json +++ b/internal/web/translation/uk-UA.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. JSON-підписка", "qrLegendLink": "{{ .Code }}. Посилання для застосунку {{ .App }}", "backupFailed": "Не вдалося прочитати базу даних; резервну копію не надіслано.", - "privateOnly": "🤖 Бот працює лише в особистих повідомленнях. Відкрий його в особистому чаті." + "privateOnly": "🤖 Бот працює лише в особистих повідомленнях. Відкрий його в особистому чаті.", + "chooseOneConfig": "👇 Який конфіг вам потрібен?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Інструкція з налаштування\nОберіть пристрій.", + "guideIos": "🍎 iPhone / iPad\n1. Встановіть Streisand або V2Box з App Store.\n2. Відкрийте сторінку посилань підписки в цьому боті та скопіюйте своє посилання.\n3. У застосунку натисніть + → Add from clipboard.\n4. Потягніть вниз для оновлення та підключайтеся.", + "guideAndroid": "🤖 Android\n1. Встановіть v2rayNG або Hiddify з Google Play.\n2. Відкрийте сторінку посилань підписки в цьому боті та скопіюйте своє посилання.\n3. У застосунку натисніть + → Import from clipboard.\n4. Оновіть підписку, оберіть сервер і підключіться.", + "guideWindows": "🪟 Windows\n1. Встановіть Hiddify або v2rayN.\n2. Відкрийте сторінку посилань підписки в цьому боті та скопіюйте своє посилання.\n3. У застосунку додайте підписку та вставте посилання.\n4. Оновіть підписку, оберіть сервер і підключіться.", + "guideMacos": "💻 macOS\n1. Встановіть Hiddify або V2Box.\n2. Відкрийте сторінку посилань підписки в цьому боті та скопіюйте своє посилання.\n3. У застосунку додайте підписку та вставте посилання.\n4. Оновіть підписку, оберіть сервер і підключіться.", + "guideLinux": "🐧 Linux\n1. Встановіть Hiddify (AppImage) або Nekoray.\n2. Відкрийте сторінку посилань підписки в цьому боті та скопіюйте своє посилання.\n3. У застосунку додайте підписку та вставте посилання.\n4. Оновіть підписку, оберіть сервер і підключіться." }, "buttons": { "closeKeyboard": "❌ Закрити клавіатуру", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Розсилка", "attachInbound": "Прив’язати інбаунд ({{ .Count }})", - "attachDone": "✅ Готово" + "attachDone": "✅ Готово", + "getOneConfig": "🎯 Отримати один", + "setupGuide": "📖 Інструкція", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Розсилку запущено.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Інструкція" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/vi-VN.json b/internal/web/translation/vi-VN.json index 3e22f51f4..210636a85 100644 --- a/internal/web/translation/vi-VN.json +++ b/internal/web/translation/vi-VN.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. Gói đăng ký JSON", "qrLegendLink": "{{ .Code }}. Liên kết ứng dụng {{ .App }}", "backupFailed": "Không đọc được cơ sở dữ liệu; không có bản sao lưu nào được gửi.", - "privateOnly": "🤖 Bot này chỉ hoạt động trong trò chuyện riêng. Hãy mở nó trong tin nhắn trực tiếp." + "privateOnly": "🤖 Bot này chỉ hoạt động trong trò chuyện riêng. Hãy mở nó trong tin nhắn trực tiếp.", + "chooseOneConfig": "👇 Bạn muốn cấu hình nào?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 Hướng dẫn cài đặt\nChọn thiết bị bạn muốn cài.", + "guideIos": "🍎 iPhone / iPad\n1. Cài Streisand hoặc V2Box từ App Store.\n2. Mở trang link đăng ký trong bot này và sao chép URL của bạn.\n3. Trong ứng dụng, nhấn + → Add from clipboard.\n4. Kéo xuống để cập nhật rồi kết nối.", + "guideAndroid": "🤖 Android\n1. Cài v2rayNG hoặc Hiddify từ Google Play.\n2. Mở trang link đăng ký trong bot này và sao chép URL của bạn.\n3. Trong ứng dụng, nhấn + → Import from clipboard.\n4. Làm mới đăng ký, chọn máy chủ rồi kết nối.", + "guideWindows": "🪟 Windows\n1. Cài Hiddify hoặc v2rayN.\n2. Mở trang link đăng ký trong bot này và sao chép URL của bạn.\n3. Trong ứng dụng, thêm một đăng ký và dán URL vào.\n4. Cập nhật đăng ký, chọn máy chủ rồi kết nối.", + "guideMacos": "💻 macOS\n1. Cài Hiddify hoặc V2Box.\n2. Mở trang link đăng ký trong bot này và sao chép URL của bạn.\n3. Trong ứng dụng, thêm một đăng ký và dán URL vào.\n4. Cập nhật đăng ký, chọn máy chủ rồi kết nối.", + "guideLinux": "🐧 Linux\n1. Cài Hiddify (AppImage) hoặc Nekoray.\n2. Mở trang link đăng ký trong bot này và sao chép URL của bạn.\n3. Trong ứng dụng, thêm một đăng ký và dán URL vào.\n4. Cập nhật đăng ký, chọn máy chủ rồi kết nối." }, "buttons": { "closeKeyboard": "❌ Đóng Bàn Phím", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 Phát tin", "attachInbound": "Đính kèm inbound ({{ .Count }})", - "attachDone": "✅ Xong" + "attachDone": "✅ Xong", + "getOneConfig": "🎯 Lấy một", + "setupGuide": "📖 Hướng dẫn cài đặt", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 Đã bắt đầu phát tin.", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "Hướng dẫn cài đặt" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/zh-CN.json b/internal/web/translation/zh-CN.json index b92fac998..3de710d48 100644 --- a/internal/web/translation/zh-CN.json +++ b/internal/web/translation/zh-CN.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. JSON 订阅", "qrLegendLink": "{{ .Code }}. 应用链接 {{ .App }}", "backupFailed": "无法读取数据库,未发送备份。", - "privateOnly": "🤖 此机器人仅在私聊中工作。请在私信中打开它。" + "privateOnly": "🤖 此机器人仅在私聊中工作。请在私信中打开它。", + "chooseOneConfig": "👇 你需要哪个配置?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 使用指南\n请选择您要配置的设备。", + "guideIos": "🍎 iPhone / iPad\n1. 从 App Store 安装 Streisand 或 V2Box。\n2. 在本机器人中打开订阅链接页面,复制您的订阅地址。\n3. 在应用中点击 + → Add from clipboard。\n4. 下拉更新,然后连接。", + "guideAndroid": "🤖 安卓\n1. 从 Google Play 安装 v2rayNG 或 Hiddify。\n2. 在本机器人中打开订阅链接页面,复制您的订阅地址。\n3. 在应用中点击 + → Import from clipboard。\n4. 更新订阅,选择服务器并连接。", + "guideWindows": "🪟 Windows\n1. 安装 Hiddify 或 v2rayN。\n2. 在本机器人中打开订阅链接页面,复制您的订阅地址。\n3. 在应用中添加订阅并粘贴地址。\n4. 更新订阅,选择服务器并连接。", + "guideMacos": "💻 macOS\n1. 安装 Hiddify 或 V2Box。\n2. 在本机器人中打开订阅链接页面,复制您的订阅地址。\n3. 在应用中添加订阅并粘贴地址。\n4. 更新订阅,选择服务器并连接。", + "guideLinux": "🐧 Linux\n1. 安装 Hiddify(AppImage)或 Nekoray。\n2. 在本机器人中打开订阅链接页面,复制您的订阅地址。\n3. 在应用中添加订阅并粘贴地址。\n4. 更新订阅,选择服务器并连接。" }, "buttons": { "closeKeyboard": "❌ 关闭键盘", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 广播", "attachInbound": "关联入站 ({{ .Count }})", - "attachDone": "✅ 完成" + "attachDone": "✅ 完成", + "getOneConfig": "🎯 获取单个", + "setupGuide": "📖 使用指南", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 安卓", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 群发已开始。", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "使用指南" }, "inline": { "noneTitle": "Nothing found", diff --git a/internal/web/translation/zh-TW.json b/internal/web/translation/zh-TW.json index f3e2d3d5b..a9394c255 100644 --- a/internal/web/translation/zh-TW.json +++ b/internal/web/translation/zh-TW.json @@ -2703,7 +2703,15 @@ "qrLegendJSON": "{{ .Code }}. JSON 訂閱", "qrLegendLink": "{{ .Code }}. 應用程式連結 {{ .App }}", "backupFailed": "無法讀取資料庫,未傳送備份。", - "privateOnly": "🤖 此機器人僅在私聊中運作。請在私訊中開啟它。" + "privateOnly": "🤖 此機器人僅在私聊中運作。請在私訊中開啟它。", + "chooseOneConfig": "👇 你需要哪個設定?", + "clientHeader": "📧 {{ .Email }}\n📅 {{ .Expiry }}\n📊 {{ .Remaining }}", + "guideChoose": "📖 使用指南\n請選擇您要設定的裝置。", + "guideIos": "🍎 iPhone / iPad\n1. 從 App Store 安裝 Streisand 或 V2Box。\n2. 在本機器人中開啟訂閱連結頁面,複製您的訂閱網址。\n3. 在應用程式中點擊 + → Add from clipboard。\n4. 下拉更新,然後連線。", + "guideAndroid": "🤖 Android\n1. 從 Google Play 安裝 v2rayNG 或 Hiddify。\n2. 在本機器人中開啟訂閱連結頁面,複製您的訂閱網址。\n3. 在應用程式中點擊 + → Import from clipboard。\n4. 更新訂閱,選擇伺服器並連線。", + "guideWindows": "🪟 Windows\n1. 安裝 Hiddify 或 v2rayN。\n2. 在本機器人中開啟訂閱連結頁面,複製您的訂閱網址。\n3. 在應用程式中新增訂閱並貼上網址。\n4. 更新訂閱,選擇伺服器並連線。", + "guideMacos": "💻 macOS\n1. 安裝 Hiddify 或 V2Box。\n2. 在本機器人中開啟訂閱連結頁面,複製您的訂閱網址。\n3. 在應用程式中新增訂閱並貼上網址。\n4. 更新訂閱,選擇伺服器並連線。", + "guideLinux": "🐧 Linux\n1. 安裝 Hiddify(AppImage)或 Nekoray。\n2. 在本機器人中開啟訂閱連結頁面,複製您的訂閱網址。\n3. 在應用程式中新增訂閱並貼上網址。\n4. 更新訂閱,選擇伺服器並連線。" }, "buttons": { "closeKeyboard": "❌ 關閉鍵盤", @@ -2763,7 +2771,14 @@ "qrCode": "🔳 QR code", "broadcast": "📢 廣播", "attachInbound": "關聯入站 ({{ .Count }})", - "attachDone": "✅ 完成" + "attachDone": "✅ 完成", + "getOneConfig": "🎯 獲取單個", + "setupGuide": "📖 使用指南", + "guideIos": "🍎 iPhone / iPad", + "guideAndroid": "🤖 Android", + "guideWindows": "🪟 Windows", + "guideMacos": "💻 macOS", + "guideLinux": "🐧 Linux" }, "answers": { "broadcastStarted": "🚀 群發已開始。", @@ -2807,7 +2822,8 @@ "onlines": "Online", "deplete": "Running out", "commands": "Commands", - "broadcast": "Broadcast" + "broadcast": "Broadcast", + "guide": "使用指南" }, "inline": { "noneTitle": "Nothing found",