mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-20 02:17:24 +00:00
fix(discord): honor disabled group history limit (#1406)
Co-authored-by: Collective Developer <man@collective.dev>
This commit is contained in:
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"]!;
|
||||
|
||||
|
||||
@@ -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,
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user