mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5387] [Feature]: Add optional fields for Telegram push notifications #3774
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3774
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lidalong50226 on GitHub (Jun 16, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5387
Is your feature request related to a problem?
It is suggested that the optional fields for Telegram push notifications be optimized to accurately identify the information source when there are multiple VPSs.
It is also suggested that Telegram push notifications for backup and log, CPU anomaly alerts, and other functions be optimized.
I have created a template for x-ui.db and uploaded it to the server. Each time a new server is deployed, it automatically downloads the version from the remote server, replaces it, and then restarts 3x-ui. This provides the necessary Telegram push notification configuration by default.
Describe the solution you'd like
However, it is suggested that the push notifications allow users to customize which fields to select, such as hostname, IP address, time, etc., to avoid single messages like "Backup time: 2026-06-16 00:00:11," as it's impossible to know which VPS the message originated from.
Thank you.
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Jun 16, 2026):
The request is partially already implemented, and partially a genuine gap — the exact picture depends on which notification type you are looking at.
What already includes server identity
tgbot_event.goprepends a bold hostname header —<b>📡 hostname</b>— to every message via theformatEventMessagefunction (lines 61–62). The CPU threshold alert you mentioned is covered here.SendReport): the server-usage block built inprepareServerUsageInfo(tgbot_report.go:94) already emits💻 Host: <hostname>,🌐 IPv4: <ip>, and🌐 IPv6: <ip>lines using thetgbot.messages.hostname/ipv4/ipv6i18n keys (en-US.json, lines 1740, 1743–1744).Confirmed gap
The
sendBackupfunction (tgbot_report.go:394–439) sends only this before attaching the files:That maps to
🗄 Backup Time: <time>with no server identity, which is exactly the scenario you described. Similarly,sendBanLogs(tgbot_report.go:442) only emits a timestamp line.What a fix would look like
Prepending the same hostname/IP block that
prepareServerUsageInfoalready generates — or even just using thehostnamepackage-level variable thatSetHostname()populates — would resolve the ambiguity for backup and ban-log messages. No new settings field is required for this minimal case.A richer opt-in (letting each admin choose which fields appear) would require a new settings entry, additional UI, and i18n work across all 13 locale files — that is a larger scope, closer to what #5303 is requesting for the periodic report format.
If you are willing to open a PR, the minimal change is in
tgbot_report.go:sendBackupandtgbot_report.go:sendBanLogs. The existinghostnamevariable (set at bot startup viaSetHostname) and thetgbot.messages.hostnamei18n key are available in the same package with no additional wiring needed.This reply was generated automatically; a maintainer may follow up.