fix(discord): honor disabled group history limit (#1406)

Co-authored-by: Collective Developer <man@collective.dev>
This commit is contained in:
ナムandCollective Developer authored and GitHub committed 2026-07-09 17:25:37 +07:00
1 parent 2b7bfec504
commit e9898be505
9 files changed
+102 -11

No files matched your search

@@ -73,6 +73,17 @@ describe("telegram configSchema", () => {
});
});
describe("discord configSchema", () => {
const discordConfig = configSchema["discord"]!;
it("matches the backend pending group history default", () => {
const historyLimit = discordConfig.find((field) => field.key === "history_limit");
expect(historyLimit).toBeDefined();
expect(historyLimit!.defaultValue).toBe(200);
expect(historyLimit!.help).toMatch(/0 = disabled/i);
});
});
describe("pancake configSchema", () => {
const pancakeConfig = configSchema["pancake"]!;
+1 -1
View File
@@ -173,7 +173,7 @@ export const configSchema: Record<string, FieldDef[]> = {
{ key: "dm_policy", label: "DM Policy", type: "select", options: dmPolicyOptions, defaultValue: "pairing" },
{ key: "group_policy", label: "Group Policy", type: "select", options: groupPolicyOptions, defaultValue: "pairing" },
{ key: "require_mention", label: "Require @mention in groups", type: "boolean", defaultValue: true },
{ key: "history_limit", label: "Group History Limit", type: "number", defaultValue: 50, help: "Max pending group messages for context (0 = disabled)" },
{ key: "history_limit", label: "Group History Limit", type: "number", defaultValue: 200, help: "Max pending group messages for context (0 = disabled)" },
{ key: "allow_from", label: "Allowed Users", type: "tags", help: "Discord user IDs" },
...chatBehaviorOverrideFields,
],