mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6486] [MERGED] feat(discord): add Discord notification bot service #6300
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#6300
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6486
Author: @poise52
Created: 9/12/2026
Status: ✅ Merged
Merged: 9/13/2026
Merged by: @MHSanaei
Base:
main← Head:feature/discord-bot📝 Commits (10+)
9811902feat(discord): add Discord notification bot service, settings UI, and event subscriberc364e16fix(discord): address PR review findings on concurrency, linting, i18n, and stories7609741docs: add Discord bot setup and operations guide3692a63feat(discord): add discordLang, discordRunTime, discordBotBackup settings and update settings UI230031efeat(discord): implement scheduled status reports and database backup attachments52dbefcfeat(discord): add interactive bot commands via Gateway WebSocket and update documentation0e80103style(discord): fix goimports formatting and add 3x-ui to gitignore8ba6d37Merge branch 'main' into feature/discord-bot055ff7aMerge branch 'main' into feature/discord-botdbfd5d6fix(discord): stop gateway panics, reconnect storms and proxy bypass📊 Changes
59 files changed (+6271 additions, -206 deletions)
View changed files
📝
.gitignore(+1 -0)📝
docs/content/docs/en/config/panel.mdx(+1 -0)➕
docs/content/docs/en/operations/discord-bot.mdx(+121 -0)📝
docs/content/docs/en/operations/meta.json(+1 -0)📝
docs/content/docs/en/reference/api/clients.mdx(+4 -2)📝
docs/content/docs/en/reference/api/settings.mdx(+8 -1)📝
docs/content/docs/fa/operations/meta.json(+1 -0)📝
docs/content/docs/ru/config/panel.mdx(+1 -0)➕
docs/content/docs/ru/operations/discord-bot.mdx(+121 -0)📝
docs/content/docs/ru/operations/meta.json(+1 -0)📝
docs/content/docs/zh/operations/meta.json(+1 -0)📝
docs/public/openapi.json(+126 -0)📝
frontend/public/openapi.json(+126 -0)📝
frontend/src/components/command-palette/CommandPalette.tsx(+8 -0)➕
frontend/src/components/ui/notifications/DiscordNotifications.stories.tsx(+89 -0)➕
frontend/src/components/ui/notifications/DiscordNotifications.tsx(+123 -0)📝
frontend/src/generated/examples.ts(+21 -0)📝
frontend/src/generated/schemas.ts(+92 -0)📝
frontend/src/generated/types.ts(+21 -0)📝
frontend/src/generated/zod.ts(+21 -0)...and 39 more files
📄 Description
Summary
Integrates native Discord notification support via a lightweight Discord REST API v10 client and the existing
internal/eventbus/infrastructure, accompanied by a dedicated Discord settings tab and event notification triggers in the UI.Why
Many server administrators prefer Discord over Telegram for monitoring server health and receiving incident alerts. This adds first-class support for Discord embeds covering system health (
cpu.high,memory.high), node status (node.down,node.up), outbound connectivity (outbound.down,outbound.up), core crashes (xray.crash), and security events (login.attempt), complete with rate limiting and secret protection.Type of change
Areas affected
How was this tested?
Automated Unit & Contract Tests:
go test -v ./internal/web/service/discord/...— all 18 tests passed (covering HTTP status codes, rate limiter semantics, rune-safe embed truncation, value/pointer event data).go test -v -run TestRouteRegistryContract ./internal/web— verified bidirectional route parity forPOST /panel/api/setting/testDiscord.npx vitest run src/test/factory-defaults-contract.test.ts— verified setting default synchronisation across Go and TypeScript.npx vitest run src/test/i18n-dead-keys.test.ts— verified 0 dead keys and exact key parity across all 13 locales.npm run typecheck && npm run lint && npm run format:check— clean.go build ./...andnpm run buildpass without warnings.Manual & Live Discord API Testing:
/settings#discord.outbound.down/up,node.down/up,xray.crash,cpu.high,memory.high,login.attempt) and confirmed color bars and embed formatting in a live Discord channel.Screenshots / recordings
Breaking changes
None
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.