mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 02:18:25 +00:00
refactor: simplify Telegram preview streaming to single boolean (#22012)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: a4017d3b94
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
@@ -154,11 +154,18 @@ export function buildTypingThreadParams(messageThreadId?: number) {
|
||||
}
|
||||
|
||||
export function resolveTelegramStreamMode(telegramCfg?: {
|
||||
streaming?: boolean;
|
||||
streamMode?: TelegramStreamMode;
|
||||
}): TelegramStreamMode {
|
||||
if (typeof telegramCfg?.streaming === "boolean") {
|
||||
return telegramCfg.streaming ? "partial" : "off";
|
||||
}
|
||||
const raw = telegramCfg?.streamMode?.trim().toLowerCase();
|
||||
if (raw === "off" || raw === "partial" || raw === "block") {
|
||||
return raw;
|
||||
if (raw === "off") {
|
||||
return "off";
|
||||
}
|
||||
if (raw === "partial" || raw === "block") {
|
||||
return "partial";
|
||||
}
|
||||
return "partial";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user