


























@@ -87,15 +87,25 @@ describe("resolveSourceReplyDeliveryMode", () => {
8787).toBe("automatic");
8888});
898990-it("treats native and text commands as explicit replies in groups", () => {
91-for (const CommandSource of ["native", "text"] as const) {
92-expect(
93-resolveSourceReplyDeliveryMode({
94-cfg: emptyConfig,
95-ctx: { ChatType: "group", CommandSource },
96-}),
97-).toBe("automatic");
98-}
90+it("treats native and authorized text commands as explicit replies in groups", () => {
91+expect(
92+resolveSourceReplyDeliveryMode({
93+cfg: emptyConfig,
94+ctx: { ChatType: "group", CommandSource: "native" },
95+}),
96+).toBe("automatic");
97+expect(
98+resolveSourceReplyDeliveryMode({
99+cfg: emptyConfig,
100+ctx: { ChatType: "group", CommandSource: "text", CommandAuthorized: true },
101+}),
102+).toBe("automatic");
103+expect(
104+resolveSourceReplyDeliveryMode({
105+cfg: emptyConfig,
106+ctx: { ChatType: "group", CommandSource: "text" },
107+}),
108+).toBe("message_tool_only");
99109});
100110101111it("falls back to automatic when message tool is unavailable", () => {
@@ -179,12 +189,15 @@ describe("resolveSourceReplyVisibilityPolicy", () => {
179189});
180190});
181191182-it("keeps native and text command replies visible in groups", () => {
183-for (const CommandSource of ["native", "text"] as const) {
192+it("keeps native and authorized text command replies visible in groups", () => {
193+for (const ctx of [
194+{ ChatType: "group", CommandSource: "native" },
195+{ ChatType: "group", CommandSource: "text", CommandAuthorized: true },
196+] as const) {
184197expect(
185198resolveSourceReplyVisibilityPolicy({
186199cfg: emptyConfig,
187-ctx: { ChatType: "group", CommandSource },
200+ ctx,
188201sendPolicy: "allow",
189202}),
190203).toMatchObject({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。