Skip to content

"Vibe-Trading: Your Personal Trading Agent"

feat(channels): give Discord a first-class Web UI config form

shadowinlifea6f7464aa794
diff --git a/agent/src/channels/config_meta.py b/agent/src/channels/config_meta.py
index 350df20cc..38642fc45 100644
--- a/agent/src/channels/config_meta.py
+++ b/agent/src/channels/config_meta.py
@@ -58,7 +58,8 @@ class FieldHint(TypedDict):
non-empty) the frontend widget renders a ``<select>`` instead of a
free-text input; option labels render the raw enum strings. Absent
for every pre-existing hint — the contract extension is additive,
- and only Slack's ``group_policy`` carries choices today.
+ and only the Slack and Discord ``group_policy`` hints carry
+ choices today.
"""
key: str
@@ -308,8 +309,71 @@ def _slack_hints() -> list[FieldHint]:
]
+# Drift pin: these literals mirror the ``group_policy: Literal["mention",
+# "open"]`` declaration on ``DiscordConfig`` and the strings the adapter
+# branches on in ``DiscordChannel._should_respond_in_group`` in discord.py —
+# the pydantic Literal is not a shared constant, so this list plus its
+# contract test is the only cross-reference. Route-side enum enforcement
+# (422 on a value outside ``choices``) is deferred to a later PR.
+_DISCORD_GROUP_POLICY_CHOICES = ["mention", "open"]
+
+
+def _discord_hints() -> list[FieldHint]:
+ """Return the hand-written Discord field hints (``enabled`` excluded).
+
+ ``required`` decision: :meth:`DiscordChannel.start` (discord.py) logs
+ "bot token not configured" and returns without connecting when ``token``
+ is empty, so the bot token is marked required — consistent with the
+ DingTalk/Feishu/Slack credential precedent, and safe because ``required``
+ is a decorative affordance (see :class:`FieldHint`).
+
+ ``secret`` decision: ``token``, ``proxy_username`` and ``proxy_password``
+ are true credentials whose key names already match :data:`SECRET_KEY_RE`,
+ so every hand-written flag agrees with the fail-safe regex and Discord
+ carries no audited ``secret=False`` subtraction (unlike slack's
+ ``user_token_read_only``) — the test-side ``_AUDITED_NON_SECRETS`` list
+ stays untouched.
+
+ ``intents`` is a gateway intent bitfield integer, not a credential: the
+ default 37377 is GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES |
+ MESSAGE_CONTENT, and MESSAGE_CONTENT is a privileged intent that must be
+ enabled in the Discord Developer Portal or the gateway rejects the
+ connection.
+ """
+ specs = (
+ ("token", "password", True, True),
+ ("allow_from", "list", False, False),
+ ("allow_channels", "list", False, False),
+ ("intents", "text", False, False),
+ ("group_policy", "text", False, False),
+ ("read_receipt_emoji", "text", False, False),
+ ("working_emoji", "text", False, False),
+ ("working_emoji_delay", "text", False, False),
+ ("streaming", "bool", False, False),
+ ("proxy", "text", False, False),
+ ("proxy_username", "password", True, False),
+ ("proxy_password", "password", True, False),
+ )
+ return [
+ {
+ "key": key,
+ "type": widget,
+ "secret": secret,
+ "required": required,
+ "help_key": f"{_HELP_KEY_PREFIX}.discord.{key}",
+ **(
+ {"choices": list(_DISCORD_GROUP_POLICY_CHOICES)}
+ if key == "group_policy"
+ else {}
+ ),
+ }
+ for key, widget, secret, required in specs
+ ]
+
+
FIELD_HINTS: dict[str, list[FieldHint]] = {
"dingtalk": _dingtalk_hints(),
+ "discord": _discord_hints(),
"email": _email_hints(),
"feishu": _feishu_hints(),
"qq": _qq_hints(),
diff --git a/agent/tests/test_channel_authoring_contract.py b/agent/tests/test_channel_authoring_contract.py
index 1a574c394..2d4f0ca7a 100644
--- a/agent/tests/test_channel_authoring_contract.py
+++ b/agent/tests/test_channel_authoring_contract.py
@@ -104,3 +104,23 @@ def test_declared_noop_keys_are_real_non_secret_non_enabled(name) -> None:
assert key in defaults, f"{name} declares noop key '{key}' absent from default_config()"
assert not is_secret_key(name, key), f"{name} declares secret '{key}' as a noop key"
assert key != "enabled", f"{name} declares 'enabled' noop (it drives start/stop)"
+
+
+def test_discord_group_policy_choices_match_the_adapter_literal() -> None:
+ """Drift pin: discord's choices mirror the adapter's Literal declaration.
+
+ ``DiscordConfig`` declares ``group_policy: Literal["mention", "open"]``
+ and ``_should_respond_in_group`` branches on the same strings; the hint's
+ ``choices`` list has no shared constant to import, so this test is the
+ cross-reference (the slack pin lives in test_channel_config_meta.py).
+ """
+ by_key = {hint["key"]: hint for hint in channel_field_hints("discord")}
+ choices = by_key["group_policy"].get("choices")
+ assert choices == ["mention", "open"]
+
+ source = (
+ Path(__file__).resolve().parents[2] / "agent/src/channels/discord.py"
+ ).read_text(encoding="utf-8")
+ assert 'group_policy: Literal["mention", "open"]' in source
+ for choice in choices:
+ assert f'group_policy == "{choice}"' in source, choice
diff --git a/agent/tests/test_channel_config_meta.py b/agent/tests/test_channel_config_meta.py
index 12b61229e..06271a954 100644
--- a/agent/tests/test_channel_config_meta.py
+++ b/agent/tests/test_channel_config_meta.py
@@ -1,9 +1,9 @@
"""Tests for channel config field metadata and fail-safe secret masking.
-Covers the uiHints registry (hand-written for DingTalk, Email, Feishu, QQ,
-Slack and WebSocket, derived elsewhere) and the security acceptance criterion:
-no key matching :data:`SECRET_KEY_RE` ever survives in the non-secret
-``values`` half.
+Covers the uiHints registry (hand-written for DingTalk, Discord, Email,
+Feishu, QQ, Slack and WebSocket, derived elsewhere) and the security
+acceptance criterion: no key matching :data:`SECRET_KEY_RE` ever survives in
+the non-secret ``values`` half.
"""
from __future__ import annotations
@@ -467,10 +467,13 @@ def test_slack_group_policy_choices_pin() -> None:
assert f'group_policy == "{choice}"' in source, choice
# Additive contract: choices is absent for every other hinted field, in
- # slack and in all pre-existing hint tables.
+ # slack, discord and all pre-existing hint tables.
for name, hints in _config_meta.FIELD_HINTS.items():
for hint in hints:
- if (name, hint["key"]) != ("slack", "group_policy"):
+ if (name, hint["key"]) not in {
+ ("slack", "group_policy"),
+ ("discord", "group_policy"),
+ }:
assert "choices" not in hint, f"{name}.{hint['key']}"
@@ -535,6 +538,112 @@ def test_slack_split_keeps_dm_dict_and_behavior_values_untouched() -> None:
assert set(values) == set(section) - {"bot_token", "app_token"}
+# --- (a2c) hand-written Discord hints ---------------------------------------- #
+
+_DISCORD_HINT_KEYS = (
+ "token",
+ "allow_from",
+ "allow_channels",
+ "intents",
+ "group_policy",
+ "read_receipt_emoji",
+ "working_emoji",
+ "working_emoji_delay",
+ "streaming",
+ "proxy",
+ "proxy_username",
+ "proxy_password",
+)
+
+
+def test_discord_field_hints_contract() -> None:
+ """Discord hints: declaration order, secrets, required set, help_key prefix."""
+ hints = channel_field_hints("discord")
+ keys = tuple(hint["key"] for hint in hints)
+ assert keys == _DISCORD_HINT_KEYS
+ assert "enabled" not in keys
+ assert len(hints) == 12
+
+ by_key = {hint["key"]: hint for hint in hints}
+ assert {key for key, hint in by_key.items() if hint["secret"]} == {
+ "token",
+ "proxy_username",
+ "proxy_password",
+ }
+ assert by_key["token"]["type"] == "password"
+ assert by_key["proxy_username"]["type"] == "password"
+ assert by_key["proxy_password"]["type"] == "password"
+ # required mirrors DiscordChannel.start(): it logs "bot token not
+ # configured" and returns without connecting when the token is empty.
+ assert {key for key, hint in by_key.items() if hint["required"]} == {"token"}
+ for hint in hints:
+ assert hint["help_key"] == f"settings.channels.fields.discord.{hint['key']}"
+
+
+def test_discord_group_policy_choices_pin() -> None:
+ """group_policy carries the enum the adapter declares.
+
+ Drift pin for the choices contract: the literals mirror the
+ ``group_policy: Literal["mention", "open"]`` declaration on DiscordConfig
+ and the strings ``DiscordChannel._should_respond_in_group`` branches on in
+ discord.py. Route-side enum enforcement is deferred to a later PR.
+ """
+ by_key = {hint["key"]: hint for hint in channel_field_hints("discord")}
+ choices = by_key["group_policy"].get("choices")
+ assert choices == ["mention", "open"]
+ assert all(isinstance(choice, str) for choice in choices)
+
+ source = (_REPO_ROOT / "agent/src/channels/discord.py").read_text(encoding="utf-8")
+ for choice in choices:
+ assert f'group_policy == "{choice}"' in source, choice
+
+
+def test_discord_hint_keys_exist_in_default_config() -> None:
+ """Every discord hint key is a real DiscordConfig field (authoring contract)."""
+ config = _section_for("discord")
+ if config is None:
+ pytest.skip("discord adapter is not loadable in this environment")
+ for hint in channel_field_hints("discord"):
+ assert hint["key"] in config
+
+
+def test_discord_secrets_are_masked_and_behavior_values_stay_visible() -> None:
+ """All three Discord credential fields mask; behavior fields stay in values.
+
+ Discord carries no audited ``secret=False`` subtraction: every
+ secret-shaped key (``token``, ``proxy_username``, ``proxy_password``) is a
+ true credential, so the hand-written flags agree with SECRET_KEY_RE and
+ ``_AUDITED_NON_SECRETS`` stays untouched.
+ """
+ section = {
+ "enabled": True,
+ "token": "dummy-token-1234",
+ "allow_from": ["123456789"],
+ "allow_channels": [],
+ "intents": 37377,
+ "group_policy": "mention",
+ "read_receipt_emoji": "👀",
+ "working_emoji": "🔧",
+ "working_emoji_delay": 2.0,
+ "streaming": True,
+ "proxy": "http://proxy.local:8080",
+ "proxy_username": "proxy-user-4321",
+ "proxy_password": "proxy-pass-5678",
+ }
+
+ values, secrets = split_values_secrets("discord", section)
+
+ assert set(secrets) == {"token", "proxy_username", "proxy_password"}
+ assert secrets["token"] == {"set": True, "masked": "****1234"}
+ assert secrets["proxy_username"] == {"set": True, "masked": "****4321"}
+ assert secrets["proxy_password"] == {"set": True, "masked": "****5678"}
+ assert values["intents"] == 37377
+ assert values["group_policy"] == "mention"
+ assert values["proxy"] == "http://proxy.local:8080"
+ assert values["allow_from"] == ["123456789"]
+ assert set(values) == set(section) - {"token", "proxy_username", "proxy_password"}
+
+
# --- (a3) hint-authoritative secret resolution ------------------------------- #
@@ -607,7 +716,7 @@ def test_derived_channel_regex_masking_unchanged() -> None:
# --- (b) fallback derivation ------------------------------------------------- #
[email protected]("name", ["discord", "telegram"])
[email protected]("name", ["telegram"])
def test_fallback_derives_types_and_secret_flags(name: str) -> None:
"""Adapters without hand-written hints derive metadata from default_config()."""
config = _section_for(name)
diff --git a/frontend/src/components/settings/ChannelConfigPanel.tsx b/frontend/src/components/settings/ChannelConfigPanel.tsx
index 56ca6b5c8..434d2145b 100644
--- a/frontend/src/components/settings/ChannelConfigPanel.tsx
+++ b/frontend/src/components/settings/ChannelConfigPanel.tsx
@@ -156,6 +156,21 @@ const GUIDE_DEFS: Record<
docsLabel: t("settings.channels.guides.feishu.docsLabel"),
}),
},
+ discord: {
+ docsUrl: "https://discord.com/developers/docs/intro",
+ build: (t) => ({
+ title: t("settings.channels.guides.discord.title"),
+ intro: t("settings.channels.guides.discord.intro"),
+ steps: [
+ t("settings.channels.guides.discord.step1"),
+ t("settings.channels.guides.discord.step2"),
+ t("settings.channels.guides.discord.step3"),
+ t("settings.channels.guides.discord.step4"),
+ t("settings.channels.guides.discord.step5"),
+ ],
+ docsLabel: t("settings.channels.guides.discord.docsLabel"),
+ }),
+ },
};
export interface ChannelConfigPanelProps {
@@ -306,6 +321,18 @@ export function ChannelConfigPanel({
"settings.channels.fields.slack.group_policy": { label: t("settings.channels.fields.slack.group_policy.label"), help: t("settings.channels.fields.slack.group_policy.help") },
"settings.channels.fields.slack.group_allow_from": { label: t("settings.channels.fields.slack.group_allow_from.label"), help: t("settings.channels.fields.slack.group_allow_from.help") },
"settings.channels.fields.slack.group_require_mention": { label: t("settings.channels.fields.slack.group_require_mention.label"), help: t("settings.channels.fields.slack.group_require_mention.help") },
+ "settings.channels.fields.discord.token": { label: t("settings.channels.fields.discord.token.label"), help: t("settings.channels.fields.discord.token.help") },
+ "settings.channels.fields.discord.allow_from": { label: t("settings.channels.fields.discord.allow_from.label"), help: t("settings.channels.fields.discord.allow_from.help") },
+ "settings.channels.fields.discord.allow_channels": { label: t("settings.channels.fields.discord.allow_channels.label"), help: t("settings.channels.fields.discord.allow_channels.help") },
+ "settings.channels.fields.discord.intents": { label: t("settings.channels.fields.discord.intents.label"), help: t("settings.channels.fields.discord.intents.help") },
+ "settings.channels.fields.discord.group_policy": { label: t("settings.channels.fields.discord.group_policy.label"), help: t("settings.channels.fields.discord.group_policy.help") },
+ "settings.channels.fields.discord.read_receipt_emoji": { label: t("settings.channels.fields.discord.read_receipt_emoji.label"), help: t("settings.channels.fields.discord.read_receipt_emoji.help") },
+ "settings.channels.fields.discord.working_emoji": { label: t("settings.channels.fields.discord.working_emoji.label"), help: t("settings.channels.fields.discord.working_emoji.help") },
+ "settings.channels.fields.discord.working_emoji_delay": { label: t("settings.channels.fields.discord.working_emoji_delay.label"), help: t("settings.channels.fields.discord.working_emoji_delay.help") },
+ "settings.channels.fields.discord.streaming": { label: t("settings.channels.fields.discord.streaming.label"), help: t("settings.channels.fields.discord.streaming.help") },
+ "settings.channels.fields.discord.proxy": { label: t("settings.channels.fields.discord.proxy.label"), help: t("settings.channels.fields.discord.proxy.help") },
+ "settings.channels.fields.discord.proxy_username": { label: t("settings.channels.fields.discord.proxy_username.label"), help: t("settings.channels.fields.discord.proxy_username.help") },
+ "settings.channels.fields.discord.proxy_password": { label: t("settings.channels.fields.discord.proxy_password.label"), help: t("settings.channels.fields.discord.proxy_password.help") },
}),
[t],
);
diff --git a/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx b/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx
index 14de4d772..346278f86 100644
--- a/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx
+++ b/frontend/src/components/settings/__tests__/ChannelSettings.test.tsx
@@ -334,6 +334,50 @@ function slackEntry(overrides: Record<string, unknown> = {}) {
};
}
+function discordEntry(overrides: Record<string, unknown> = {}) {
+ return {
+ display_name: "Discord",
+ available: true,
+ loaded: true,
+ install_hint: "",
+ error: "",
+ supports_test: true,
+ sdk_available: true,
+ fields: [
+ { key: "token", type: "password", secret: true, required: true, help_key: "settings.channels.fields.discord.token" },
+ { key: "allow_from", type: "list", secret: false, required: false, help_key: "settings.channels.fields.discord.allow_from" },
+ { key: "allow_channels", type: "list", secret: false, required: false, help_key: "settings.channels.fields.discord.allow_channels" },
+ { key: "intents", type: "text", secret: false, required: false, help_key: "settings.channels.fields.discord.intents" },
+ { key: "group_policy", type: "text", secret: false, required: false, help_key: "settings.channels.fields.discord.group_policy", choices: ["mention", "open"] },
+ { key: "read_receipt_emoji", type: "text", secret: false, required: false, help_key: "settings.channels.fields.discord.read_receipt_emoji" },
+ { key: "working_emoji", type: "text", secret: false, required: false, help_key: "settings.channels.fields.discord.working_emoji" },
+ { key: "working_emoji_delay", type: "text", secret: false, required: false, help_key: "settings.channels.fields.discord.working_emoji_delay" },
+ { key: "streaming", type: "bool", secret: false, required: false, help_key: "settings.channels.fields.discord.streaming" },
+ { key: "proxy", type: "text", secret: false, required: false, help_key: "settings.channels.fields.discord.proxy" },
+ { key: "proxy_username", type: "password", secret: true, required: false, help_key: "settings.channels.fields.discord.proxy_username" },
+ { key: "proxy_password", type: "password", secret: true, required: false, help_key: "settings.channels.fields.discord.proxy_password" },
+ ],
+ values: {
+ enabled: false,
+ allow_from: [],
+ allow_channels: [],
+ intents: 37377,
+ group_policy: "mention",
+ read_receipt_emoji: "👀",
+ working_emoji: "🔧",
+ working_emoji_delay: 2,
+ streaming: true,
+ proxy: "",
+ },
+ secrets: {
+ token: { set: true, masked: "****cdef" },
+ proxy_username: { set: true, masked: "****user" },
+ proxy_password: { set: true, masked: "****pass" },
+ },
+ ...overrides,
+ };
+}
+
function channelsConfig(overrides: Record<string, unknown> = {}) {
return {
config_path: "~/.vibe-trading/agent.json",
@@ -401,6 +445,17 @@ async function renderSlackExpanded() {
expect(await screen.findByDisplayValue("eyes")).toBeInTheDocument();
}
+/** Render the card with the Discord config panel expanded. */
+async function renderDiscordExpanded() {
+ apiMock.getChannelsConfig.mockResolvedValue(channelsConfig({
+ channels: { dingtalk: dingtalkEntry(), discord: discordEntry() },
+ }));
+ render(<ChannelSettings />);
+ await screen.findByText("IM Channels");
+ fireEvent.click(await screen.findByRole("button", { name: "Configure Discord" }));
+ expect(await screen.findByDisplayValue("37377")).toBeInTheDocument();
+}
+
/** Render the card with the three guided IM channels available. */
function guidedChannelsConfig() {
return channelsConfig({
@@ -996,6 +1051,104 @@ describe("ChannelSettings config panel", () => {
]);
});
+ it("renders every Discord field from the backend help_keys with localized labels", async () => {
+ await renderDiscordExpanded();
+
+ expect(screen.getByText("Bot token")).toBeInTheDocument();
+ expect(screen.getByText("Allowed senders")).toBeInTheDocument();
+ expect(screen.getByText("Allowed channels")).toBeInTheDocument();
+ expect(screen.getByText("Gateway intents")).toBeInTheDocument();
+ expect(screen.getByText("Group policy")).toBeInTheDocument();
+ expect(screen.getByText("Read receipt emoji")).toBeInTheDocument();
+ expect(screen.getByText("Working emoji")).toBeInTheDocument();
+ expect(screen.getByText("Working emoji delay (s)")).toBeInTheDocument();
+ expect(screen.getByText("Streaming replies")).toBeInTheDocument();
+ expect(screen.getByText("Proxy URL")).toBeInTheDocument();
+ expect(screen.getByText("Proxy username")).toBeInTheDocument();
+ expect(screen.getByText("Proxy password")).toBeInTheDocument();
+ expect(screen.getByText(/MESSAGE CONTENT is a privileged intent/)).toBeInTheDocument();
+ // token is the only required field: the decorative asterisk marks it.
+ expect(screen.getByText("Bot token").textContent).toContain("*");
+ // All three credentials keep the generic masked placeholder and password type.
+ for (const masked of ["****cdef", "****user", "****pass"]) {
+ const secretInput = screen.getByPlaceholderText(`Keep current (${masked})`);
+ expect(secretInput).toHaveAttribute("type", "password");
+ expect(secretInput).toHaveValue("");
+ }
+ });
+
+ it("renders the Discord group_policy choices as a select with mention and open", async () => {
+ await renderDiscordExpanded();
+
+ const select = screen.getByLabelText("Group policy");
+ expect(select.tagName).toBe("SELECT");
+ expect(Array.from(select.querySelectorAll("option")).map((option) => option.value)).toEqual([
+ "mention",
+ "open",
+ ]);
+ expect(select).toHaveValue("mention");
+
+ // The select flows through the same form-state path as text inputs.
+ fireEvent.change(select, { target: { value: "open" } });
+ expect(select).toHaveValue("open");
+ fireEvent.click(screen.getByRole("button", { name: "Save configuration" }));
+
+ await waitFor(() => expect(apiMock.putChannelConfig).toHaveBeenCalledTimes(1));
+ expect(apiMock.putChannelConfig).toHaveBeenLastCalledWith("discord", {
+ config: expect.objectContaining({ group_policy: "open" }),
+ });
+ });
+
+ it("never renders smuggled Discord secret values, only the masked placeholders", async () => {
+ // A contract-violating response that carries raw secrets in `values`
+ // still must not reach the DOM: secret widgets bind to empty drafts.
+ const discord = discordEntry({
+ values: {
+ ...discordEntry().values,
+ token: "leaked-bot-token",
+ proxy_username: "leaked-proxy-user",
+ proxy_password: "leaked-proxy-pass",
+ },
+ });
+ apiMock.getChannelsConfig.mockResolvedValue(channelsConfig({ channels: { discord } }));
+ render(<ChannelSettings />);
+ await screen.findByText("IM Channels");
+ fireEvent.click(await screen.findByRole("button", { name: "Configure Discord" }));
+ expect(await screen.findByDisplayValue("37377")).toBeInTheDocument();
+
+ const secretInputs = Array.from(document.querySelectorAll("input[type=password]"));
+ expect(secretInputs).toHaveLength(3);
+ for (const secretInput of secretInputs) {
+ expect(secretInput).toHaveValue("");
+ }
+ expect(document.body.textContent).not.toContain("leaked-bot-token");
+ expect(document.body.textContent).not.toContain("leaked-proxy-user");
+ expect(document.body.textContent).not.toContain("leaked-proxy-pass");
+ });
+
+ it("toggles the Discord setup guide with its steps and external link", async () => {
+ await renderDiscordExpanded();
+
+ expect(screen.queryByText(/Create an application in the Discord Developer Portal/)).not.toBeInTheDocument();
+
+ const guideToggle = screen.getByRole("button", { name: "Discord setup guide" });
+ expect(guideToggle).toHaveAttribute("aria-expanded", "false");
+ fireEvent.click(guideToggle);
+
+ expect(guideToggle).toHaveAttribute("aria-expanded", "true");
+ expect(screen.getByText(/Create an application in the Discord Developer Portal/)).toBeInTheDocument();
+ expect(screen.getByText(/reset the token/)).toBeInTheDocument();
+ expect(screen.getByText(/enable MESSAGE CONTENT INTENT/)).toBeInTheDocument();
+ expect(screen.getByText(/applications\.commands/)).toBeInTheDocument();
+ expect(screen.getByText(/click Test connection, then enable the channel/)).toBeInTheDocument();
+ expect(screen.getByRole("link", { name: "Open the Discord developer documentation" }))
+ .toHaveAttribute("href", "https://discord.com/developers/docs/intro");
+
+ fireEvent.click(guideToggle);
+ expect(guideToggle).toHaveAttribute("aria-expanded", "false");
+ expect(screen.queryByText(/Create an application in the Discord Developer Portal/)).not.toBeInTheDocument();
+ });
+
it("renders no setup guide for a channel without a guide definition", async () => {
apiMock.getChannelsConfig.mockResolvedValue(channelsConfig({
channels: {
diff --git a/frontend/src/i18n/locales/ar.json b/frontend/src/i18n/locales/ar.json
index 3ba032df8..8297f2e53 100644
--- a/frontend/src/i18n/locales/ar.json
+++ b/frontend/src/i18n/locales/ar.json
@@ -912,6 +912,56 @@
"label": "اشتراط الإشارة في القنوات المسموح بها",
"help": "مع سياسة \"allowlist\"، اشتراط الإشارة إلى البوت أيضًا قبل الرد في القنوات المعتمدة. لا تأثير لها مع \"mention\" أو \"open\"."
}
+ },
+ "discord": {
+ "token": {
+ "label": "رمز البوت",
+ "help": "رمز البوت (Bot Token) من بوابة مطوّري Discord، وليس رمز مستخدم أو رمز OAuth. يُحفظ في الخادم ولا يُعاد إلى المتصفح أبدًا."
+ },
+ "allow_from": {
+ "label": "المُرسلون المسموح بهم",
+ "help": "قائمة سماح اختيارية بمعرّفات مستخدمي Discord المسموح لهم بمحادثة الوكيل. اتركها فارغة للسماح للجميع."
+ },
+ "allow_channels": {
+ "label": "القنوات المسموح بها",
+ "help": "قائمة سماح اختيارية بمعرّفات قنوات Discord التي يرد فيها البوت. اتركها فارغة للسماح بكل القنوات."
+ },
+ "intents": {
+ "label": "نوايا البوابة",
+ "help": "حقل بتات لنوايا البوابة (Gateway Intents) بصيغة عدد صحيح (الافتراضي 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT). نية MESSAGE CONTENT مميزة ويجب تفعيلها في بوابة المطوّرين وإلا فشل البوت في الاتصال."
+ },
+ "group_policy": {
+ "label": "سياسة المجموعات",
+ "help": "\"mention\" للرد فقط عند الإشارة إلى البوت في قنوات الخادم، و\"open\" للرد على كل رسائل القنوات (مع الخضوع لقوائم السماح)."
+ },
+ "read_receipt_emoji": {
+ "label": "تفاعل تأكيد الاستلام",
+ "help": "التفاعل الذي يوضع فورًا على الرسالة الواردة تأكيدًا لاستلامها (الافتراضي 👀)، ويُزال بمجرد وصول الرد."
+ },
+ "working_emoji": {
+ "label": "تفاعل حالة العمل",
+ "help": "التفاعل الذي يوضع أثناء عمل الوكيل (الافتراضي 🔧)، ويُضاف بعد تأخير تفاعل حالة العمل."
+ },
+ "working_emoji_delay": {
+ "label": "تأخير تفاعل حالة العمل (ثانية)",
+ "help": "عدد الثواني قبل إضافة تفاعل حالة العمل، حتى لا يظهر في الردود السريعة (الافتراضي 2.0)."
+ },
+ "streaming": {
+ "label": "بث الرد تدريجيًا",
+ "help": "بث الرد عبر التحرير التدريجي لرسالة Discord واحدة بدل إرسال رسالة نهائية واحدة."
+ },
+ "proxy": {
+ "label": "عنوان الوكيل",
+ "help": "وسيط HTTP اختياري يمر عبره اتصال البوابة واستدعاءات الواجهة، مثل http://host:port."
+ },
+ "proxy_username": {
+ "label": "اسم مستخدم الوكيل",
+ "help": "اسم مستخدم الوكيل؛ يجب إدخاله مع كلمة مرور الوكيل أو تركهما معًا — يُتجاهل الزوج الناقص مع تحذير. يُحفظ في الخادم ولا يُعاد إلى المتصفح أبدًا."
+ },
+ "proxy_password": {
+ "label": "كلمة مرور الوكيل",
+ "help": "كلمة مرور الوكيل؛ يجب إدخالها مع اسم مستخدم الوكيل أو تركهما معًا — يُتجاهل الزوج الناقص مع تحذير. يُحفظ في الخادم ولا يُعاد إلى المتصفح أبدًا."
+ }
}
},
"guides": {
@@ -964,6 +1014,16 @@
"step4": "انسخ معرّف التطبيق (App ID) وسر التطبيق (App Secret) من صفحة «بيانات الاعتماد والمعلومات الأساسية» والصقهما في الحقلين أعلاه.",
"step5": "أنشئ إصدارًا وانشر التطبيق (قد تتطلب مؤسستك موافقة المسؤول)، ثم فعّل القناة من هنا فتُطبَّق التغييرات فورًا دون إعادة تشغيل. في بيئات Lark الدولية اضبط النطاق على lark.",
"docsLabel": "فتح منصة Feishu للمطورين"
+ },
+ "discord": {
+ "title": "دليل إعداد Discord",
+ "intro": "تتصل بوتات Discord بالبوابة عبر رمز البوت، لذا لا حاجة إلى عنوان IP عام أو رابط ويب هوك.",
+ "step1": "أنشئ تطبيقًا في بوابة مطوّري Discord (discord.com/developers).",
+ "step2": "افتح صفحة Bot، وأعد تعيين الرمز (Reset Token)، وانسخه.",
+ "step3": "ضمن Privileged Gateway Intents، فعّل MESSAGE CONTENT INTENT — فالنوايا الافتراضية تتطلبه.",
+ "step4": "أنشئ رابط دعوة OAuth2 بنطاق bot (وapplications.commands) وأضف البوت إلى خادمك.",
+ "step5": "الصق الرمز هنا، وانقر «اختبار الاتصال»، ثم فعّل القناة.",
+ "docsLabel": "افتح وثائق مطوّري Discord"
}
}
},
diff --git a/frontend/src/i18n/locales/de.json b/frontend/src/i18n/locales/de.json
index 24beb373c..d92c81288 100644
--- a/frontend/src/i18n/locales/de.json
+++ b/frontend/src/i18n/locales/de.json
@@ -917,6 +917,56 @@
"label": "Erwähnung in erlaubten Channels erforderlich",
"help": "Mit der Richtlinie \"allowlist\" zusätzlich eine @-Erwähnung verlangen, bevor in zugelassenen Channels geantwortet wird. Ohne Wirkung für \"mention\" oder \"open\"."
}
+ },
+ "discord": {
+ "token": {
+ "label": "Bot-Token",
+ "help": "Das Bot-Token aus dem Discord Developer Portal — kein User- oder OAuth-Token. Wird serverseitig gespeichert und nie an den Browser zurückgegeben."
+ },
+ "allow_from": {
+ "label": "Erlaubte Absender",
+ "help": "Allowlist von Discord-User-IDs, die mit dem Agenten sprechen dürfen. Leer lassen, um alle zuzulassen."
+ },
+ "allow_channels": {
+ "label": "Erlaubte Channels",
+ "help": "Allowlist von Discord-Channel-IDs, in denen der Bot antwortet. Leer lassen, um alle Channels zuzulassen."
+ },
+ "intents": {
+ "label": "Gateway-Intents",
+ "help": "Gateway-Intent-Bitfeld als Ganzzahl (Standard 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT). MESSAGE CONTENT ist ein privilegiertes Intent, das im Developer Portal aktiviert werden muss, sonst kann sich der Bot nicht verbinden."
+ },
+ "group_policy": {
+ "label": "Gruppenrichtlinie",
+ "help": "\"mention\" antwortet nur bei @-Erwähnung in einem Server-Channel, \"open\" antwortet auf alle Channel-Nachrichten (weiterhin gemäß den Allowlists)."
+ },
+ "read_receipt_emoji": {
+ "label": "Lesebestätigungs-Emoji",
+ "help": "Emoji, mit dem eine eingehende Nachricht sofort quittiert wird (Standard: 👀); wird nach der Antwort entfernt."
+ },
+ "working_emoji": {
+ "label": "Arbeits-Emoji",
+ "help": "Emoji, mit dem reagiert wird, während der Agent noch arbeitet (Standard: 🔧); erscheint nach der Arbeits-Emoji-Verzögerung."
+ },
+ "working_emoji_delay": {
+ "label": "Arbeits-Emoji-Verzögerung (s)",
+ "help": "Sekunden, bevor das Arbeits-Emoji hinzugefügt wird, damit schnelle Antworten es nie zeigen (Standard: 2.0)."
+ },
+ "streaming": {
+ "label": "Streaming-Antworten",
+ "help": "Die Antwort streamen, indem eine Discord-Nachricht fortlaufend bearbeitet wird, statt sie am Ende als eine Nachricht zu senden."
+ },
+ "proxy": {
+ "label": "Proxy-URL",
+ "help": "Optionaler HTTP-Proxy für die Gateway-Verbindung und API-Aufrufe, z. B. http://host:port."
+ },
+ "proxy_username": {
+ "label": "Proxy-Benutzername",
+ "help": "Benutzername für den Proxy; zusammen mit dem Proxy-Passwort oder gar nicht angeben — ein halb angegebenes Paar wird mit einer Warnung ignoriert. Wird serverseitig gespeichert und nie an den Browser zurückgegeben."
+ },
+ "proxy_password": {
+ "label": "Proxy-Passwort",
+ "help": "Passwort für den Proxy; zusammen mit dem Proxy-Benutzernamen oder gar nicht angeben — ein halb angegebenes Paar wird mit einer Warnung ignoriert. Wird serverseitig gespeichert und nie an den Browser zurückgegeben."
+ }
}
},
"guides": {
@@ -969,6 +1019,16 @@
"step4": "Kopiere App ID und App Secret aus „Anmeldedaten & Basisinformationen“ und füge sie oben ein.",
"step5": "Erstelle eine Version und veröffentliche die App (je nach Tenant mit Admin-Freigabe), dann aktiviere den Kanal hier — er wird ohne Neustart heiß übernommen. Für internationale Lark-Tenants die Domain auf lark setzen.",
"docsLabel": "Feishu Open Platform öffnen"
+ },
+ "discord": {
+ "title": "Discord-Einrichtungsanleitung",
+ "intro": "Discord-Bots verbinden sich mit einem Bot-Token über das Gateway; eine öffentliche IP oder Webhook-URL ist nicht nötig.",
+ "step1": "Erstelle eine Anwendung im Discord Developer Portal (discord.com/developers).",
+ "step2": "Öffne die Bot-Seite, setze das Token zurück und kopiere es.",
+ "step3": "Aktiviere unter Privileged Gateway Intents die MESSAGE CONTENT INTENT — die Standard-Intents benötigen sie.",
+ "step4": "Erzeuge eine OAuth2-Einlade-URL mit dem bot-Scope (und applications.commands) und füge den Bot zu deinem Server hinzu.",
+ "step5": "Füge das Token hier ein, klicke auf „Verbindung testen“ und aktiviere dann den Kanal.",
+ "docsLabel": "Discord-Entwicklerdokumentation öffnen"
}
}
},
diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json
index a4d982924..78ffb0881 100644
--- a/frontend/src/i18n/locales/en.json
+++ b/frontend/src/i18n/locales/en.json
@@ -917,6 +917,56 @@
"label": "Require mention in allowed channels",
"help": "With the \"allowlist\" policy, also require an @mention before replying in approved channels. No effect for \"mention\" or \"open\"."
}
+ },
+ "discord": {
+ "token": {
+ "label": "Bot token",
+ "help": "The bot token from the Discord Developer Portal — not a user or OAuth token. Stored server-side and never sent back to the browser."
+ },
+ "allow_from": {
+ "label": "Allowed senders",
+ "help": "Optional allowlist of Discord user IDs that may talk to the agent. Leave empty to allow everyone."
+ },
+ "allow_channels": {
+ "label": "Allowed channels",
+ "help": "Optional allowlist of Discord channel IDs the bot responds in. Leave empty to allow every channel."
+ },
+ "intents": {
+ "label": "Gateway intents",
+ "help": "Gateway intent bitfield as an integer (default 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT). MESSAGE CONTENT is a privileged intent that must be enabled in the Developer Portal or the bot fails to connect."
+ },
+ "group_policy": {
+ "label": "Group policy",
+ "help": "\"mention\" replies only when the bot is @mentioned in a server channel, \"open\" replies to all channel messages (still subject to the allowlists)."
+ },
+ "read_receipt_emoji": {
+ "label": "Read receipt emoji",
+ "help": "Emoji reacted on an incoming message right away to acknowledge it (default 👀); removed once the reply arrives."
+ },
+ "working_emoji": {
+ "label": "Working emoji",
+ "help": "Emoji reacted while the agent is still working (default 🔧), added after the working emoji delay."
+ },
+ "working_emoji_delay": {
+ "label": "Working emoji delay (s)",
+ "help": "Seconds to wait before adding the working emoji, so quick replies never show it (default 2.0)."
+ },
+ "streaming": {
+ "label": "Streaming replies",
+ "help": "Stream the reply by progressively editing one Discord message instead of sending a single final message."
+ },
+ "proxy": {
+ "label": "Proxy URL",
+ "help": "Optional HTTP proxy the gateway connection and API calls go through, e.g. http://host:port."
+ },
+ "proxy_username": {
+ "label": "Proxy username",
+ "help": "Username for the proxy; set it together with the proxy password or not at all — a half-specified pair is ignored with a warning. Stored server-side and never sent back to the browser."
+ },
+ "proxy_password": {
+ "label": "Proxy password",
+ "help": "Password for the proxy; set it together with the proxy username or not at all — a half-specified pair is ignored with a warning. Stored server-side and never sent back to the browser."
+ }
}
},
"guides": {
@@ -969,6 +1019,16 @@
"step4": "Copy the App ID and App Secret from Credentials & Basic Info and paste them into the fields above.",
"step5": "Create a version and publish the app (admin approval if your tenant requires it), then enable the channel here — it hot-applies with no restart. For international Lark tenants, set domain to \"lark\".",
"docsLabel": "Open the Feishu Open Platform"
+ },
+ "discord": {
+ "title": "Discord setup guide",
+ "intro": "Discord bots connect over the gateway with a bot token, so no public IP or webhook URL is needed.",
+ "step1": "Create an application in the Discord Developer Portal (discord.com/developers).",
+ "step2": "Open the Bot page, reset the token, and copy it.",
+ "step3": "Under Privileged Gateway Intents, enable MESSAGE CONTENT INTENT — the default intents require it.",
+ "step4": "Generate an OAuth2 invite URL with the bot (and applications.commands) scope and add the bot to your server.",
+ "step5": "Paste the token here, click Test connection, then enable the channel.",
+ "docsLabel": "Open the Discord developer documentation"
}
}
},
diff --git a/frontend/src/i18n/locales/es.json b/frontend/src/i18n/locales/es.json
index 560e0dd6b..923ef9ad2 100644
--- a/frontend/src/i18n/locales/es.json
+++ b/frontend/src/i18n/locales/es.json
@@ -917,6 +917,56 @@
"label": "Requerir mención en canales permitidos",
"help": "Con la política \"allowlist\", exigir además una @mención antes de responder en los canales aprobados. Sin efecto para \"mention\" u \"open\"."
}
+ },
+ "discord": {
+ "token": {
+ "label": "Token del bot",
+ "help": "El token del bot desde el portal de desarrolladores de Discord (no un token de usuario ni OAuth). Se guarda en el servidor y nunca se devuelve al navegador."
+ },
+ "allow_from": {
+ "label": "Remitentes permitidos",
+ "help": "Lista blanca opcional de IDs de usuario de Discord que pueden hablar con el agente. Déjala vacía para permitir a todos."
+ },
+ "allow_channels": {
+ "label": "Canales permitidos",
+ "help": "Lista blanca opcional de IDs de canales de Discord en los que el bot responde. Déjala vacía para permitir todos los canales."
+ },
+ "intents": {
+ "label": "Intents del gateway",
+ "help": "Campo de bits de intents del gateway como entero (por defecto 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT). MESSAGE CONTENT es un intent privilegiado que debe activarse en el portal de desarrolladores o el bot no podrá conectarse."
+ },
+ "group_policy": {
+ "label": "Política de grupos",
+ "help": "\"mention\": responde solo cuando se menciona al bot con @ en un canal del servidor; \"open\": responde a todos los mensajes del canal (sin salir de las listas blancas)."
+ },
+ "read_receipt_emoji": {
+ "label": "Emoji de lectura",
+ "help": "Emoji con el que se acusa recibo de un mensaje entrante de inmediato (por defecto 👀); se retira cuando llega la respuesta."
+ },
+ "working_emoji": {
+ "label": "Emoji de procesamiento",
+ "help": "Emoji con el que se reacciona mientras el agente sigue trabajando (por defecto 🔧); se añade tras el retardo del emoji de procesamiento."
+ },
+ "working_emoji_delay": {
+ "label": "Retardo del emoji de procesamiento (s)",
+ "help": "Segundos que se esperan antes de añadir el emoji de procesamiento, para que las respuestas rápidas nunca lo muestren (por defecto 2.0)."
+ },
+ "streaming": {
+ "label": "Respuestas en streaming",
+ "help": "Transmitir la respuesta editando progresivamente un único mensaje de Discord en lugar de enviar un solo mensaje final."
+ },
+ "proxy": {
+ "label": "URL del proxy",
+ "help": "Proxy HTTP opcional por el que pasan la conexión al gateway y las llamadas a la API, p. ej. http://host:port."
+ },
+ "proxy_username": {
+ "label": "Usuario del proxy",
+ "help": "Usuario del proxy; debe indicarse junto con la contraseña del proxy o no indicarse: un par a medias se ignora con un aviso. Se guarda en el servidor y nunca se devuelve al navegador."
+ },
+ "proxy_password": {
+ "label": "Contraseña del proxy",
+ "help": "Contraseña del proxy; debe indicarse junto con el usuario del proxy o no indicarse: un par a medias se ignora con un aviso. Se guarda en el servidor y nunca se devuelve al navegador."
+ }
}
},
"guides": {
@@ -969,6 +1019,16 @@
"step4": "Copia el App ID y el App Secret desde Credenciales e información básica y pégalos en los campos de arriba.",
"step5": "Crea una versión y publica la aplicación (con aprobación del administrador si tu tenant lo exige); después activa el canal: se aplica en caliente, sin reiniciar. En tenants internacionales de Lark, pon el dominio en lark.",
"docsLabel": "Abrir la plataforma para desarrolladores de Feishu"
+ },
+ "discord": {
+ "title": "Guía de configuración de Discord",
+ "intro": "Los bots de Discord se conectan al gateway con un token de bot, así que no necesitas IP pública ni webhook.",
+ "step1": "Crea una aplicación en el portal de desarrolladores de Discord (discord.com/developers).",
+ "step2": "Abre la página Bot, restablece el token y cópialo.",
+ "step3": "En Privileged Gateway Intents, activa MESSAGE CONTENT INTENT (los intents por defecto lo requieren).",
+ "step4": "Genera una URL de invitación OAuth2 con el ámbito bot (y applications.commands) y añade el bot a tu servidor.",
+ "step5": "Pega aquí el token, pulsa «Probar conexión» y activa el canal.",
+ "docsLabel": "Abrir la documentación para desarrolladores de Discord"
}
}
},
diff --git a/frontend/src/i18n/locales/id.json b/frontend/src/i18n/locales/id.json
index f3acc3d47..17b860b81 100644
--- a/frontend/src/i18n/locales/id.json
+++ b/frontend/src/i18n/locales/id.json
@@ -917,6 +917,56 @@
"label": "Wajib sebut di kanal yang diizinkan",
"help": "Dengan kebijakan \"allowlist\", juga mewajibkan @mention sebelum membalas di kanal yang disetujui. Tidak berpengaruh pada \"mention\" atau \"open\"."
}
+ },
+ "discord": {
+ "token": {
+ "label": "Token bot",
+ "help": "Token bot dari Discord Developer Portal — bukan token pengguna atau OAuth. Disimpan di sisi server dan tidak pernah dikirim kembali ke peramban."
+ },
+ "allow_from": {
+ "label": "Pengirim yang diizinkan",
+ "help": "Daftar putih opsional ID pengguna Discord yang boleh berbicara dengan agen. Biarkan kosong untuk mengizinkan semua orang."
+ },
+ "allow_channels": {
+ "label": "Kanal yang diizinkan",
+ "help": "Daftar putih opsional ID kanal Discord tempat bot merespons. Biarkan kosong untuk mengizinkan semua kanal."
+ },
+ "intents": {
+ "label": "Gateway intent",
+ "help": "Bitfield gateway intent berupa bilangan bulat (default 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT). MESSAGE CONTENT adalah intent istimewa yang harus diaktifkan di Developer Portal, jika tidak bot gagal terhubung."
+ },
+ "group_policy": {
+ "label": "Kebijakan grup",
+ "help": "\"mention\" hanya membalas saat bot disebut (@mention) di kanal server, \"open\" membalas semua pesan kanal (tetap tunduk pada daftar putih)."
+ },
+ "read_receipt_emoji": {
+ "label": "Emoji tanda dibaca",
+ "help": "Emoji yang direaksikan pada pesan masuk sebagai tanda terima (default 👀); dihapus setelah balasan tiba."
+ },
+ "working_emoji": {
+ "label": "Emoji saat bekerja",
+ "help": "Emoji yang direaksikan saat agen masih bekerja (default 🔧), ditambahkan setelah penundaan emoji saat bekerja."
+ },
+ "working_emoji_delay": {
+ "label": "Penundaan emoji saat bekerja (dtk)",
+ "help": "Detik sebelum emoji saat bekerja ditambahkan, sehingga balasan cepat tidak pernah menampilkannya (default 2.0)."
+ },
+ "streaming": {
+ "label": "Balasan streaming",
+ "help": "Mengalirkan balasan dengan menyunting satu pesan Discord secara bertahap, alih-alih mengirim satu pesan final."
+ },
+ "proxy": {
+ "label": "URL proksi",
+ "help": "Proksi HTTP opsional yang dilalui koneksi gateway dan panggilan API, misalnya http://host:port."
+ },
+ "proxy_username": {
+ "label": "Nama pengguna proksi",
+ "help": "Nama pengguna proksi; isi berpasangan dengan kata sandi proksi atau tidak sama sekali — pasangan yang setengah diisi diabaikan dengan peringatan. Disimpan di sisi server dan tidak pernah dikirim kembali ke peramban."
+ },
+ "proxy_password": {
+ "label": "Kata sandi proksi",
+ "help": "Kata sandi proksi; isi berpasangan dengan nama pengguna proksi atau tidak sama sekali — pasangan yang setengah diisi diabaikan dengan peringatan. Disimpan di sisi server dan tidak pernah dikirim kembali ke peramban."
+ }
}
},
"guides": {
@@ -969,6 +1019,16 @@
"step4": "Salin App ID dan App Secret dari halaman Kredensial & Info Dasar, lalu tempel di kolom di atas.",
"step5": "Buat versi dan publikasikan aplikasi (perlu persetujuan admin jika tenant Anda mensyaratkannya), lalu aktifkan kanal di sini — berlaku seketika tanpa restart. Untuk tenant Lark internasional, set domain ke lark.",
"docsLabel": "Buka Feishu Open Platform"
+ },
+ "discord": {
+ "title": "Panduan setup Discord",
+ "intro": "Bot Discord terhubung ke gateway dengan token bot, jadi tidak perlu IP publik maupun webhook.",
+ "step1": "Buat aplikasi di Discord Developer Portal (discord.com/developers).",
+ "step2": "Buka halaman Bot, atur ulang token, lalu salin.",
+ "step3": "Di Privileged Gateway Intents, aktifkan MESSAGE CONTENT INTENT — intent default membutuhkannya.",
+ "step4": "Buat URL undangan OAuth2 dengan cakupan bot (dan applications.commands), lalu tambahkan bot ke server Anda.",
+ "step5": "Tempel token di sini, klik Uji koneksi, lalu aktifkan kanal.",
+ "docsLabel": "Buka dokumentasi pengembang Discord"
}
}
},
diff --git a/frontend/src/i18n/locales/ja.json b/frontend/src/i18n/locales/ja.json
index 616bd5ec2..1a3827ec2 100644
--- a/frontend/src/i18n/locales/ja.json
+++ b/frontend/src/i18n/locales/ja.json
@@ -912,6 +912,56 @@
"label": "許可チャンネルでメンションを要求",
"help": "「allowlist」ポリシーで、承認済みチャンネルでも @ メンションされたときのみ返信します。「mention」と「open」には影響しません。"
}
+ },
+ "discord": {
+ "token": {
+ "label": "ボットトークン",
+ "help": "Discord Developer Portal のボットトークンです(ユーザートークンや OAuth トークンではありません)。サーバー側に保存され、ブラウザに返されることはありません。"
+ },
+ "allow_from": {
+ "label": "許可する送信者",
+ "help": "エージェントと会話できる Discord ユーザー ID の許可リスト。空欄ですべて許可します。"
+ },
+ "allow_channels": {
+ "label": "許可するチャンネル",
+ "help": "ボットが応答する Discord チャンネル ID の許可リスト。空欄ですべてのチャンネルを許可します。"
+ },
+ "intents": {
+ "label": "ゲートウェイインテント",
+ "help": "ゲートウェイインテントのビットフィールド整数(デフォルト 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT)。MESSAGE CONTENT は特権インテントで、Developer Portal で有効にしないとボットは接続できません。"
+ },
+ "group_policy": {
+ "label": "グループポリシー",
+ "help": "「mention」はサーバーのチャンネルで @ メンションされたときのみ返信し、「open」はすべてのチャンネルメッセージに返信します(いずれも許可リストに従います)。"
+ },
+ "read_receipt_emoji": {
+ "label": "既読リアクション",
+ "help": "受信メッセージにすぐ付ける確認用のリアクション(デフォルトは 👀)。返信が届くと削除されます。"
+ },
+ "working_emoji": {
+ "label": "作業中リアクション",
+ "help": "エージェントが作業中の間に付けるリアクション(デフォルトは 🔧)。作業中リアクションの遅延後に追加されます。"
+ },
+ "working_emoji_delay": {
+ "label": "作業中リアクションの遅延(秒)",
+ "help": "作業中リアクションを付けるまでの待機秒数。短い返信では表示されません(デフォルト 2.0)。"
+ },
+ "streaming": {
+ "label": "ストリーミング返信",
+ "help": "最終メッセージを一度に送信する代わりに、1 通の Discord メッセージを逐次編集して返信をストリーミングします。"
+ },
+ "proxy": {
+ "label": "プロキシ URL",
+ "help": "ゲートウェイ接続と API 呼び出しが経由する任意の HTTP プロキシ(例:http://host:port)。"
+ },
+ "proxy_username": {
+ "label": "プロキシのユーザー名",
+ "help": "プロキシのユーザー名(パスワードと組で設定してください。片方だけの場合は警告とともに無視されます)。サーバー側に保存され、ブラウザに返されることはありません。"
+ },
+ "proxy_password": {
+ "label": "プロキシのパスワード",
+ "help": "プロキシのパスワード(ユーザー名と組で設定してください。片方だけの場合は警告とともに無視されます)。サーバー側に保存され、ブラウザに返されることはありません。"
+ }
}
},
"guides": {
@@ -964,6 +1014,16 @@
"step4": "「認証情報と基本情報」から App ID と App Secret をコピーして、上の欄に貼り付けます。",
"step5": "バージョンを作成してアプリを公開し(テナントの仕様により管理者の承認が必要な場合があります)、ここでチャンネルを有効にすると再起動不要で即座に反映されます。国際版 Lark のテナントはドメインを lark に設定してください。",
"docsLabel": "Feishu Open Platform を開く"
+ },
+ "discord": {
+ "title": "Discord セットアップガイド",
+ "intro": "Discord ボットはボットトークンでゲートウェイに接続するため、公開 IP も Webhook も不要です。",
+ "step1": "Discord Developer Portal(discord.com/developers)でアプリケーションを作成します。",
+ "step2": "Bot ページを開き、トークンをリセットしてコピーします。",
+ "step3": "Privileged Gateway Intents で MESSAGE CONTENT INTENT を有効にします(デフォルトのインテントに必要です)。",
+ "step4": "bot(および applications.commands)スコープの OAuth2 招待 URL を生成し、ボットをサーバーに追加します。",
+ "step5": "ここにトークンを貼り付け、「接続テスト」をクリックしてからチャンネルを有効にします。",
+ "docsLabel": "Discord 開発者ドキュメントを開く"
}
}
},
diff --git a/frontend/src/i18n/locales/ko.json b/frontend/src/i18n/locales/ko.json
index d887514f9..99a5eb565 100644
--- a/frontend/src/i18n/locales/ko.json
+++ b/frontend/src/i18n/locales/ko.json
@@ -912,6 +912,56 @@
"label": "허용 채널에서 멘션 요구",
"help": "\"allowlist\" 정책에서 승인된 채널에서도 @ 멘션되어야 답변합니다. \"mention\"과 \"open\" 정책에는 영향이 없습니다."
}
+ },
+ "discord": {
+ "token": {
+ "label": "봇 토큰",
+ "help": "Discord 개발자 포털의 봇 토큰입니다(사용자 토큰이나 OAuth 토큰이 아님). 서버 측에만 저장되며 브라우저로는 절대 반환되지 않습니다."
+ },
+ "allow_from": {
+ "label": "허용된 발신자",
+ "help": "에이전트와 대화할 수 있는 Discord 사용자 ID 허용 목록. 비워 두면 모두 허용됩니다."
+ },
+ "allow_channels": {
+ "label": "허용된 채널",
+ "help": "봇이 응답할 Discord 채널 ID 허용 목록. 비워 두면 모든 채널이 허용됩니다."
+ },
+ "intents": {
+ "label": "게이트웨이 인텐트",
+ "help": "게이트웨이 인텐트 비트필드 정수(기본값 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT). MESSAGE CONTENT는 특권 인텐트라 개발자 포털에서 활성화해야 하며, 그렇지 않으면 봇이 연결에 실패합니다."
+ },
+ "group_policy": {
+ "label": "그룹 정책",
+ "help": "\"mention\"은 서버 채널에서 @ 멘션될 때만 답변하고, \"open\"은 모든 채널 메시지에 답변합니다(허용 목록의 제약을 받음)."
+ },
+ "read_receipt_emoji": {
+ "label": "읽음 확인 이모지",
+ "help": "메시지 수신 즉시 추가되는 확인용 이모지(기본값 👀). 답변이 도착하면 제거됩니다."
+ },
+ "working_emoji": {
+ "label": "작업 중 이모지",
+ "help": "에이전트가 아직 작업 중일 때 추가할 이모지(기본값 🔧). 작업 중 이모지 지연 시간 후에 추가됩니다."
+ },
+ "working_emoji_delay": {
+ "label": "작업 중 이모지 지연(초)",
+ "help": "작업 중 이모지를 추가하기까지 기다릴 초 수. 빠른 답변에는 표시되지 않습니다(기본값 2.0)."
+ },
+ "streaming": {
+ "label": "스트리밍 답변",
+ "help": "최종 메시지를 한 번에 보내는 대신 하나의 Discord 메시지를 점진적으로 편집하며 답변을 스트리밍합니다."
+ },
+ "proxy": {
+ "label": "프록시 URL",
+ "help": "게이트웨이 연결과 API 호출이 거쳐 가는 선택적 HTTP 프록시(예: http://host:port)."
+ },
+ "proxy_username": {
+ "label": "프록시 사용자 이름",
+ "help": "프록시 사용자 이름(프록시 비밀번호와 함께 설정해야 하며, 한쪽만 지정하면 경고와 함께 무시됩니다). 서버 측에만 저장되며 브라우저로는 절대 반환되지 않습니다."
+ },
+ "proxy_password": {
+ "label": "프록시 비밀번호",
+ "help": "프록시 비밀번호(프록시 사용자 이름과 함께 설정해야 하며, 한쪽만 지정하면 경고와 함께 무시됩니다). 서버 측에만 저장되며 브라우저로는 절대 반환되지 않습니다."
+ }
}
},
"guides": {
@@ -964,6 +1014,16 @@
"step4": "'자격 증명 및 기본 정보'에서 App ID와 App Secret을 복사해 위 입력칸에 붙여넣으세요.",
"step5": "버전을 만들어 앱을 게시(테넌트에 따라 관리자 승인 필요)한 뒤 여기서 채널을 활성화하면 재시작 없이 즉시 적용됩니다. 국제 Lark 테넌트는 도메인을 lark로 설정하세요.",
"docsLabel": "Feishu 오픈 플랫폼 열기"
+ },
+ "discord": {
+ "title": "Discord 설정 가이드",
+ "intro": "Discord 봇은 봇 토큰으로 게이트웨이에 연결하므로 공개 IP나 웹훅이 필요 없습니다.",
+ "step1": "Discord 개발자 포털(discord.com/developers)에서 애플리케이션을 만드세요.",
+ "step2": "Bot 페이지를 열고 토큰을 재설정(Reset Token)한 뒤 복사하세요.",
+ "step3": "Privileged Gateway Intents에서 MESSAGE CONTENT INTENT를 활성화하세요(기본 인텐트에 필요합니다).",
+ "step4": "bot(및 applications.commands) 범위의 OAuth2 초대 URL을 생성해 봇을 서버에 추가하세요.",
+ "step5": "여기에 토큰을 붙여넣고 '연결 테스트'를 클릭한 다음 채널을 사용 설정하세요.",
+ "docsLabel": "Discord 개발자 문서 열기"
}
}
},
diff --git a/frontend/src/i18n/locales/pt-BR.json b/frontend/src/i18n/locales/pt-BR.json
index 6919795a2..07c8fd23d 100644
--- a/frontend/src/i18n/locales/pt-BR.json
+++ b/frontend/src/i18n/locales/pt-BR.json
@@ -917,6 +917,56 @@
"label": "Exigir menção nos canais permitidos",
"help": "Com a política \"allowlist\", exigir também uma @menção antes de responder nos canais aprovados. Sem efeito para \"mention\" ou \"open\"."
}
+ },
+ "discord": {
+ "token": {
+ "label": "Token do bot",
+ "help": "O token do bot obtido no Portal de Desenvolvedores do Discord — não um token de usuário ou OAuth. Armazenado no servidor e nunca devolvido ao navegador."
+ },
+ "allow_from": {
+ "label": "Remetentes permitidos",
+ "help": "Lista de permissão opcional de IDs de usuário do Discord que podem falar com o agente. Deixe vazio para permitir todos."
+ },
+ "allow_channels": {
+ "label": "Canais permitidos",
+ "help": "Lista de permissão opcional de IDs de canais do Discord nos quais o bot responde. Deixe vazio para permitir todos os canais."
+ },
+ "intents": {
+ "label": "Intents do gateway",
+ "help": "Campo de bits de intents do gateway como inteiro (padrão 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT). MESSAGE CONTENT é um intent privilegiado que deve ser ativado no Portal de Desenvolvedores, senão o bot não conecta."
+ },
+ "group_policy": {
+ "label": "Política de grupos",
+ "help": "\"mention\" responde apenas quando o bot é mencionado com @ em um canal do servidor, \"open\" responde a todas as mensagens do canal (ainda sujeito às listas de permissão)."
+ },
+ "read_receipt_emoji": {
+ "label": "Emoji de confirmação de leitura",
+ "help": "Emoji adicionado como reação a uma mensagem recebida para confirmá-la de imediato (padrão 👀); removido quando a resposta chega."
+ },
+ "working_emoji": {
+ "label": "Emoji de processamento",
+ "help": "Emoji adicionado como reação enquanto o agente ainda trabalha (padrão 🔧), após o atraso do emoji de processamento."
+ },
+ "working_emoji_delay": {
+ "label": "Atraso do emoji de processamento (s)",
+ "help": "Segundos antes de adicionar o emoji de processamento, para que respostas rápidas nunca o mostrem (padrão 2.0)."
+ },
+ "streaming": {
+ "label": "Respostas em streaming",
+ "help": "Transmitir a resposta editando progressivamente uma única mensagem do Discord em vez de enviar uma mensagem final única."
+ },
+ "proxy": {
+ "label": "URL do proxy",
+ "help": "Proxy HTTP opcional pelo qual passam a conexão ao gateway e as chamadas de API, p. ex. http://host:port."
+ },
+ "proxy_username": {
+ "label": "Usuário do proxy",
+ "help": "Usuário do proxy; informe-o junto com a senha do proxy ou não informe nenhum — um par pela metade é ignorado com um aviso. Armazenado no servidor e nunca devolvido ao navegador."
+ },
+ "proxy_password": {
+ "label": "Senha do proxy",
+ "help": "Senha do proxy; informe-a junto com o usuário do proxy ou não informe nenhum — um par pela metade é ignorado com um aviso. Armazenado no servidor e nunca devolvido ao navegador."
+ }
}
},
"guides": {
@@ -969,6 +1019,16 @@
"step4": "Copie o App ID e o App Secret em Credenciais e informações básicas e cole-os nos campos acima.",
"step5": "Crie uma versão e publique o aplicativo (com aprovação do administrador se o seu tenant exigir); em seguida, ative o canal aqui — a aplicação é imediata, sem reiniciar. Em tenants internacionais do Lark, defina o domínio como lark.",
"docsLabel": "Abrir a plataforma de desenvolvedores do Feishu"
+ },
+ "discord": {
+ "title": "Guia de configuração do Discord",
+ "intro": "Bots do Discord conectam-se ao gateway com um token de bot, então não é preciso IP público nem webhook.",
+ "step1": "Crie uma aplicação no Portal de Desenvolvedores do Discord (discord.com/developers).",
+ "step2": "Abra a página Bot, redefina o token e copie-o.",
+ "step3": "Em Privileged Gateway Intents, ative MESSAGE CONTENT INTENT — os intents padrão o exigem.",
+ "step4": "Gere uma URL de convite OAuth2 com o escopo bot (e applications.commands) e adicione o bot ao seu servidor.",
+ "step5": "Cole o token aqui, clique em “Testar conexão” e ative o canal.",
+ "docsLabel": "Abrir a documentação de desenvolvedores do Discord"
}
}
},
diff --git a/frontend/src/i18n/locales/zh-CN.json b/frontend/src/i18n/locales/zh-CN.json
index d38e0663f..de27095fc 100644
--- a/frontend/src/i18n/locales/zh-CN.json
+++ b/frontend/src/i18n/locales/zh-CN.json
@@ -912,6 +912,56 @@
"label": "允许频道内需提及",
"help": "在“allowlist”策略下,已批准的频道中还需 @ 提及机器人才回复。对“mention”和“open”策略无效。"
}
+ },
+ "discord": {
+ "token": {
+ "label": "Bot 令牌",
+ "help": "来自 Discord 开发者门户(Developer Portal)的机器人令牌(Bot Token),不是用户令牌或 OAuth 令牌。保存在服务端,绝不会回传到浏览器。"
+ },
+ "allow_from": {
+ "label": "允许的发送者",
+ "help": "允许与智能体对话的 Discord 用户 ID 白名单。留空表示允许所有人。"
+ },
+ "allow_channels": {
+ "label": "允许的频道",
+ "help": "机器人会响应的 Discord 频道 ID 白名单。留空表示允许所有频道。"
+ },
+ "intents": {
+ "label": "网关意图",
+ "help": "网关意图(Gateway Intents)位域整数(默认 37377 = GUILDS | GUILD_MESSAGES | DIRECT_MESSAGES | MESSAGE_CONTENT)。其中 MESSAGE CONTENT 是特权意图,必须在开发者门户中开启,否则机器人无法连接。"
+ },
+ "group_policy": {
+ "label": "群聊策略",
+ "help": "“mention”表示在服务器频道中仅在被 @ 提及时回复;“open”表示回复所有频道消息(仍受白名单约束)。"
+ },
+ "read_receipt_emoji": {
+ "label": "已读回执表情",
+ "help": "收到消息时立即添加的表情回应,表示已接收(默认 👀);回复送达后自动移除。"
+ },
+ "working_emoji": {
+ "label": "处理中表情",
+ "help": "智能体仍在处理时添加的表情回应(默认 🔧),在“处理中表情延迟”之后出现。"
+ },
+ "working_emoji_delay": {
+ "label": "处理中表情延迟(秒)",
+ "help": "等待多少秒后才添加处理中表情,快速回复将不会显示它(默认 2.0)。"
+ },
+ "streaming": {
+ "label": "流式回复",
+ "help": "以持续编辑同一条 Discord 消息的方式流式输出回复,而不是等完成后一次性发送。"
+ },
+ "proxy": {
+ "label": "代理地址",
+ "help": "可选的 HTTP 代理,网关连接与 API 调用会经由它转发,例如 http://host:port。"
+ },
+ "proxy_username": {
+ "label": "代理用户名",
+ "help": "代理的用户名;需与代理密码成对填写,只填一半会被忽略并记录警告。保存在服务端,绝不会回传到浏览器。"
+ },
+ "proxy_password": {
+ "label": "代理密码",
+ "help": "代理的密码;需与代理用户名成对填写,只填一半会被忽略并记录警告。保存在服务端,绝不会回传到浏览器。"
+ }
}
},
"guides": {
@@ -964,6 +1014,16 @@
"step4": "在“凭证与基础信息”页面复制 App ID 与 App Secret,填入上方字段。",
"step5": "创建版本并发布应用(若租户要求,需管理员审批),然后回到这里启用渠道——即时生效、无需重启;国际版 Lark 租户请将域名设为“lark”。",
"docsLabel": "打开飞书开放平台"
+ },
+ "discord": {
+ "title": "Discord 配置指南",
+ "intro": "Discord 机器人使用 Bot 令牌通过网关(Gateway)连接,无需公网 IP 或回调地址。",
+ "step1": "在 Discord 开发者门户(discord.com/developers)创建应用。",
+ "step2": "打开 Bot 页面,重置令牌(Reset Token)并复制。",
+ "step3": "在 Privileged Gateway Intents 下开启 MESSAGE CONTENT INTENT——默认意图需要它。",
+ "step4": "生成带 bot(及 applications.commands)权限范围的 OAuth2 邀请链接,把机器人加入你的服务器。",
+ "step5": "回到这里粘贴令牌,点击“测试连接”,然后启用渠道。",
+ "docsLabel": "打开 Discord 开发者文档"
}
}
},