mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
test(discord): cover auto-thread skip types
This commit is contained in:
@@ -48,6 +48,7 @@ Docs: https://docs.openclaw.ai
|
||||
- Telegram: preserve private-chat topic `message_thread_id` on outbound sends (message/sticker/poll), keep thread-not-found retry fallback, and avoid masking `chat not found` routing errors. (#18993) Thanks @obviyus.
|
||||
- Discord: prevent duplicate media delivery when the model uses the `message send` tool with media, by skipping media extraction from messaging tool results since the tool already sent the message directly. (#18270)
|
||||
- Discord: route `audioAsVoice` auto-replies through the voice message API so opt-in audio renders as voice messages. (#18041) Thanks @zerone0x.
|
||||
- Discord: skip auto-thread creation in forum/media/voice/stage channels and keep group session last-route metadata fresh to avoid invalid thread API errors and lost follow-up sends. (#18098) Thanks @Clawborn.
|
||||
- Discord/Commands: normalize `commands.allowFrom` entries with `user:`/`discord:`/`pk:` prefixes and `<@id>` mentions so command authorization matches Discord allowlist behavior. (#18042)
|
||||
- Telegram: keep draft-stream preview replies attached to the user message for `replyToMode: "all"` in groups and DMs, preserving threaded reply context from preview through finalization. (#17880) Thanks @yinghaosang.
|
||||
- Telegram: prevent streaming final replies from being overwritten by later final/error payloads, and suppress fallback tool-error warnings when a recovered assistant answer already exists after tool calls. (#17883) Thanks @Marvae and @obviyus.
|
||||
|
||||
@@ -43,6 +43,36 @@ describe("maybeCreateDiscordAutoThread", () => {
|
||||
expect(postMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("skips auto-thread if channelType is GuildVoice", async () => {
|
||||
const result = await maybeCreateDiscordAutoThread({
|
||||
client: mockClient,
|
||||
message: mockMessage,
|
||||
messageChannelId: "voice1",
|
||||
isGuildMessage: true,
|
||||
channelConfig: { allowed: true, autoThread: true },
|
||||
channelType: ChannelType.GuildVoice,
|
||||
baseText: "test",
|
||||
combinedBody: "test",
|
||||
});
|
||||
expect(result).toBeUndefined();
|
||||
expect(postMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("skips auto-thread if channelType is GuildStageVoice", async () => {
|
||||
const result = await maybeCreateDiscordAutoThread({
|
||||
client: mockClient,
|
||||
message: mockMessage,
|
||||
messageChannelId: "stage1",
|
||||
isGuildMessage: true,
|
||||
channelConfig: { allowed: true, autoThread: true },
|
||||
channelType: ChannelType.GuildStageVoice,
|
||||
baseText: "test",
|
||||
combinedBody: "test",
|
||||
});
|
||||
expect(result).toBeUndefined();
|
||||
expect(postMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("creates auto-thread if channelType is GuildText", async () => {
|
||||
postMock.mockResolvedValueOnce({ id: "thread1" });
|
||||
const result = await maybeCreateDiscordAutoThread({
|
||||
|
||||
Reference in New Issue
Block a user