diff --git a/src/channels/plugins/config-helpers.ts b/src/channels/plugins/config-helpers.ts index 25a57e355..0afb802c3 100644 --- a/src/channels/plugins/config-helpers.ts +++ b/src/channels/plugins/config-helpers.ts @@ -106,10 +106,7 @@ export function deleteAccountFromConfigSection(params: { } as ClawdbotConfig; } - const nextChannels = { ...(params.cfg.channels ?? {}) } as Record< - string, - unknown - >; + const nextChannels = { ...params.cfg.channels } as Record; delete nextChannels[params.sectionKey]; const nextCfg = { ...params.cfg } as ClawdbotConfig; if (Object.keys(nextChannels).length > 0) { diff --git a/src/channels/plugins/msteams.ts b/src/channels/plugins/msteams.ts index 3b0534495..ca7a5a73e 100644 --- a/src/channels/plugins/msteams.ts +++ b/src/channels/plugins/msteams.ts @@ -67,7 +67,7 @@ export const msteamsPlugin: ChannelPlugin = { }), deleteAccount: ({ cfg }) => { const next = { ...cfg } as ClawdbotConfig; - const nextChannels = { ...(cfg.channels ?? {}) }; + const nextChannels = { ...cfg.channels }; delete nextChannels.msteams; if (Object.keys(nextChannels).length > 0) { next.channels = nextChannels; diff --git a/src/channels/plugins/telegram.ts b/src/channels/plugins/telegram.ts index 27da8d406..5004fce55 100644 --- a/src/channels/plugins/telegram.ts +++ b/src/channels/plugins/telegram.ts @@ -462,7 +462,7 @@ export const telegramPlugin: ChannelPlugin = { if (nextTelegram && Object.keys(nextTelegram).length > 0) { nextCfg.channels = { ...nextCfg.channels, telegram: nextTelegram }; } else { - const nextChannels = { ...(nextCfg.channels ?? {}) }; + const nextChannels = { ...nextCfg.channels }; delete nextChannels.telegram; if (Object.keys(nextChannels).length > 0) { nextCfg.channels = nextChannels; diff --git a/src/commands/configure.ts b/src/commands/configure.ts index eda306e8c..5d3f78c60 100644 --- a/src/commands/configure.ts +++ b/src/commands/configure.ts @@ -620,7 +620,7 @@ async function removeChannelConfigWizard( ); if (!confirmed) continue; - const nextChannels: Record = { ...(next.channels ?? {}) }; + const nextChannels: Record = { ...next.channels }; delete nextChannels[channel]; next = { ...next,