mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 04:16:25 +00:00
fix(channels): align command-body parsing sources
This commit is contained in:
@@ -1098,14 +1098,15 @@ export async function processMessage(
|
||||
});
|
||||
}
|
||||
}
|
||||
const commandBody = messageText.trim();
|
||||
|
||||
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
||||
Body: body,
|
||||
BodyForAgent: rawBody,
|
||||
InboundHistory: inboundHistory,
|
||||
RawBody: rawBody,
|
||||
CommandBody: rawBody,
|
||||
BodyForCommands: rawBody,
|
||||
CommandBody: commandBody,
|
||||
BodyForCommands: commandBody,
|
||||
MediaUrl: mediaUrls[0],
|
||||
MediaUrls: mediaUrls.length > 0 ? mediaUrls : undefined,
|
||||
MediaPath: mediaPaths[0],
|
||||
|
||||
@@ -638,6 +638,7 @@ export async function monitorMattermostProvider(opts: MonitorMattermostOpts = {}
|
||||
|
||||
const to = kind === "direct" ? `user:${senderId}` : `channel:${channelId}`;
|
||||
const mediaPayload = buildAgentMediaPayload(mediaList);
|
||||
const commandBody = rawText.trim();
|
||||
const inboundHistory =
|
||||
historyKey && historyLimit > 0
|
||||
? (channelHistories.get(historyKey) ?? []).map((entry) => ({
|
||||
@@ -651,7 +652,8 @@ export async function monitorMattermostProvider(opts: MonitorMattermostOpts = {}
|
||||
BodyForAgent: bodyText,
|
||||
InboundHistory: inboundHistory,
|
||||
RawBody: bodyText,
|
||||
CommandBody: bodyText,
|
||||
CommandBody: commandBody,
|
||||
BodyForCommands: commandBody,
|
||||
From:
|
||||
kind === "direct"
|
||||
? `mattermost:${senderId}`
|
||||
|
||||
@@ -495,13 +495,15 @@ export function createMSTeamsMessageHandler(deps: MSTeamsMessageHandlerDeps) {
|
||||
timestamp: entry.timestamp,
|
||||
}))
|
||||
: undefined;
|
||||
const commandBody = text.trim();
|
||||
|
||||
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
||||
Body: combinedBody,
|
||||
BodyForAgent: rawBody,
|
||||
InboundHistory: inboundHistory,
|
||||
RawBody: rawBody,
|
||||
CommandBody: rawBody,
|
||||
CommandBody: commandBody,
|
||||
BodyForCommands: commandBody,
|
||||
From: teamsFrom,
|
||||
To: teamsTo,
|
||||
SessionKey: route.sessionKey,
|
||||
|
||||
@@ -64,6 +64,7 @@ export function createSignalEventHandler(deps: SignalEventHandlerDeps) {
|
||||
groupName?: string;
|
||||
isGroup: boolean;
|
||||
bodyText: string;
|
||||
commandBody: string;
|
||||
timestamp?: number;
|
||||
messageId?: string;
|
||||
mediaPath?: string;
|
||||
@@ -147,7 +148,8 @@ export function createSignalEventHandler(deps: SignalEventHandlerDeps) {
|
||||
BodyForAgent: entry.bodyText,
|
||||
InboundHistory: inboundHistory,
|
||||
RawBody: entry.bodyText,
|
||||
CommandBody: entry.bodyText,
|
||||
CommandBody: entry.commandBody,
|
||||
BodyForCommands: entry.commandBody,
|
||||
From: entry.isGroup
|
||||
? `group:${entry.groupId ?? "unknown"}`
|
||||
: `signal:${entry.senderRecipient}`,
|
||||
@@ -691,6 +693,7 @@ export function createSignalEventHandler(deps: SignalEventHandlerDeps) {
|
||||
groupName,
|
||||
isGroup,
|
||||
bodyText,
|
||||
commandBody: messageText,
|
||||
timestamp: envelope.timestamp ?? undefined,
|
||||
messageId,
|
||||
mediaPath,
|
||||
|
||||
@@ -611,13 +611,15 @@ export async function prepareSlackMessage(params: {
|
||||
timestamp: entry.timestamp,
|
||||
}))
|
||||
: undefined;
|
||||
const commandBody = textForCommandDetection.trim();
|
||||
|
||||
const ctxPayload = finalizeInboundContext({
|
||||
Body: combinedBody,
|
||||
BodyForAgent: rawBody,
|
||||
InboundHistory: inboundHistory,
|
||||
RawBody: rawBody,
|
||||
CommandBody: rawBody,
|
||||
CommandBody: commandBody,
|
||||
BodyForCommands: commandBody,
|
||||
From: slackFrom,
|
||||
To: slackTo,
|
||||
SessionKey: sessionKey,
|
||||
|
||||
Reference in New Issue
Block a user