mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 03:28:29 +00:00
fix(telegram): clean up update offset on channels remove --delete (#18233)
This commit is contained in:
committed by
Peter Steinberger
parent
b91e43714b
commit
6757a9fedc
@@ -7,6 +7,7 @@ import {
|
||||
import { type OpenClawConfig, writeConfigFile } from "../../config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../routing/session-key.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../../runtime.js";
|
||||
import { deleteTelegramUpdateOffset } from "../../telegram/update-offset-store.js";
|
||||
import { createClackPrompter } from "../../wizard/clack-prompter.js";
|
||||
import { type ChatChannel, channelLabel, requireValidConfig, shouldUseWizard } from "./shared.js";
|
||||
|
||||
@@ -112,6 +113,11 @@ export async function channelsRemoveCommand(
|
||||
cfg: next,
|
||||
accountId: resolvedAccountId,
|
||||
});
|
||||
|
||||
// Clean up Telegram polling offset to prevent stale offset on bot token change (#18233)
|
||||
if (channel === "telegram") {
|
||||
await deleteTelegramUpdateOffset({ accountId: resolvedAccountId });
|
||||
}
|
||||
} else {
|
||||
if (!plugin.config.setAccountEnabled) {
|
||||
runtime.error(`Channel ${channel} does not support disable.`);
|
||||
|
||||
Reference in New Issue
Block a user