mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 04:32:44 +00:00
fix: align reply threading refs
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
resolveDiscordReplyTarget,
|
||||
resolveDiscordShouldRequireMention,
|
||||
resolveGroupDmAllow,
|
||||
sanitizeDiscordThreadName,
|
||||
shouldEmitDiscordReactionNotification,
|
||||
} from "./monitor.js";
|
||||
|
||||
@@ -326,6 +327,21 @@ describe("discord reply target selection", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("discord autoThread name sanitization", () => {
|
||||
it("strips mentions and collapses whitespace", () => {
|
||||
const name = sanitizeDiscordThreadName(
|
||||
" <@123> <@&456> <#789> Help here ",
|
||||
"msg-1",
|
||||
);
|
||||
expect(name).toBe("Help here");
|
||||
});
|
||||
|
||||
it("falls back to thread + id when empty after cleaning", () => {
|
||||
const name = sanitizeDiscordThreadName(" <@123>", "abc");
|
||||
expect(name).toBe("Thread abc");
|
||||
});
|
||||
});
|
||||
|
||||
describe("discord reaction notification gating", () => {
|
||||
it("defaults to own when mode is unset", () => {
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user