mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 20:13:43 +00:00
Discord: align embed fallback in thread starter parsing
This commit is contained in:
@@ -7,7 +7,11 @@ import { buildAgentSessionKey } from "../../routing/resolve-route.js";
|
||||
import { truncateUtf16Safe } from "../../utils.js";
|
||||
import type { DiscordChannelConfigResolved } from "./allow-list.js";
|
||||
import type { DiscordMessageEvent } from "./listeners.js";
|
||||
import { resolveDiscordChannelInfo, resolveDiscordMessageChannelId } from "./message-utils.js";
|
||||
import {
|
||||
resolveDiscordChannelInfo,
|
||||
resolveDiscordEmbedText,
|
||||
resolveDiscordMessageChannelId,
|
||||
} from "./message-utils.js";
|
||||
|
||||
export type DiscordThreadChannel = {
|
||||
id: string;
|
||||
@@ -172,7 +176,7 @@ export async function resolveDiscordThreadStarter(params: {
|
||||
Routes.channelMessage(messageChannelId, params.channel.id),
|
||||
)) as {
|
||||
content?: string | null;
|
||||
embeds?: Array<{ description?: string | null }>;
|
||||
embeds?: Array<{ title?: string | null; description?: string | null }>;
|
||||
member?: { nick?: string | null; displayName?: string | null };
|
||||
author?: {
|
||||
id?: string | null;
|
||||
@@ -184,7 +188,9 @@ export async function resolveDiscordThreadStarter(params: {
|
||||
if (!starter) {
|
||||
return null;
|
||||
}
|
||||
const text = starter.content?.trim() ?? starter.embeds?.[0]?.description?.trim() ?? "";
|
||||
const content = starter.content?.trim() ?? "";
|
||||
const embedText = resolveDiscordEmbedText(starter.embeds?.[0]);
|
||||
const text = content || embedText;
|
||||
if (!text) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user