mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 10:51:10 +00:00
fix: guard malformed Telegram replies and pass hook accountId
This commit is contained in:
@@ -445,12 +445,14 @@ export const registerTelegramNativeCommands = ({
|
||||
};
|
||||
const buildCommandDeliveryBaseOptions = (params: {
|
||||
chatId: string | number;
|
||||
accountId: string;
|
||||
mediaLocalRoots?: readonly string[];
|
||||
threadSpec: ReturnType<typeof resolveTelegramThreadSpec>;
|
||||
tableMode: ReturnType<typeof resolveMarkdownTableMode>;
|
||||
chunkMode: ReturnType<typeof resolveChunkMode>;
|
||||
}) => ({
|
||||
chatId: String(params.chatId),
|
||||
accountId: params.accountId,
|
||||
token: opts.token,
|
||||
runtime,
|
||||
bot,
|
||||
@@ -513,6 +515,7 @@ export const registerTelegramNativeCommands = ({
|
||||
});
|
||||
const deliveryBaseOptions = buildCommandDeliveryBaseOptions({
|
||||
chatId,
|
||||
accountId: route.accountId,
|
||||
mediaLocalRoots,
|
||||
threadSpec,
|
||||
tableMode,
|
||||
@@ -726,7 +729,7 @@ export const registerTelegramNativeCommands = ({
|
||||
return;
|
||||
}
|
||||
const { senderId, commandAuthorized, isGroup, isForum, resolvedThreadId } = auth;
|
||||
const { threadSpec, mediaLocalRoots, tableMode, chunkMode } =
|
||||
const { threadSpec, route, mediaLocalRoots, tableMode, chunkMode } =
|
||||
resolveCommandRuntimeContext({
|
||||
msg,
|
||||
isGroup,
|
||||
@@ -735,6 +738,7 @@ export const registerTelegramNativeCommands = ({
|
||||
});
|
||||
const deliveryBaseOptions = buildCommandDeliveryBaseOptions({
|
||||
chatId,
|
||||
accountId: route.accountId,
|
||||
mediaLocalRoots,
|
||||
threadSpec,
|
||||
tableMode,
|
||||
|
||||
Reference in New Issue
Block a user