3x-ui/internal/web/service/tgbot
Sanaei 02f2a63c53
refactor(tgbot): extract the shared numeric keypad builder
Six callback flows — limit_traffic, reset_exp, ip_limit and their
add_client_* counterparts — each carried the same 28-line inline keyboard:
cancel, confirm, the 1-9 grid, clear, 0 and backspace. Only the callback
prefix, the threaded email argument, the cancel target and the confirm
label key ever differed, and the labels had already drifted apart between
otherwise identical flows.

numericKeypad now builds that grid from a numericKeypadSpec, cutting 168
lines to 6. The callback data is unchanged: every one of the 84 strings
and all 6 label keys were diffed against the pre-refactor router and are
byte-identical, which matters because encodeQuery hashes any query over
64 chars and buttons already sitting in a user's chat carry these
strings.
2026-09-10 21:07:57 +02:00
..
numeric_input.go refactor(tgbot): extract the shared numeric keypad builder 2026-09-10 21:07:57 +02:00
numeric_input_test.go test(tgbot): detect open-coded keypad transitions (#6214) 2026-08-15 15:27:02 +02:00
tgbot.go chore(lint): adapt to staticcheck v0.8.0 under golangci-lint v2.13.1 2026-08-20 19:37:40 +02:00
tgbot_callback_auth_test.go Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
tgbot_client.go chore(lint): adapt to staticcheck v0.8.0 under golangci-lint v2.13.1 2026-08-20 19:37:40 +02:00
tgbot_delete_after_test.go Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
tgbot_event.go feat(memory): add memory threshold alerts (#5366) 2026-06-21 17:45:33 +02:00
tgbot_inbound.go fix(tgbot): close stale-inbound TOCTOU and contain handler panics (#6442) 2026-09-10 09:41:52 +02:00
tgbot_report.go fix(database): create SQLite backup snapshots online (#6137) 2026-07-29 21:04:55 +02:00
tgbot_router.go refactor(tgbot): extract the shared numeric keypad builder 2026-09-10 21:07:57 +02:00
tgbot_send.go Update deps and simplify parsing 2026-09-08 14:12:13 +02:00
tgbot_send_test.go fix(tgbot): use a token telego accepts in the edit-message tests 2026-09-06 17:32:01 +02:00
tgbot_stale_button_test.go fix(tgbot): close stale-inbound TOCTOU and contain handler panics (#6442) 2026-09-10 09:41:52 +02:00
tgbot_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00