Format: fix report + telegram formatting
This commit is contained in:
committed by
Peter Steinberger
parent
232c512502
commit
393d21d86c
@@ -91,11 +91,7 @@ export const registerTelegramHandlers = ({
|
||||
const newChatId = String(msg.migrate_to_chat_id);
|
||||
const chatTitle = (msg.chat as { title?: string }).title ?? "Unknown";
|
||||
|
||||
runtime.log?.(
|
||||
warn(
|
||||
`[telegram] Group migrated: "${chatTitle}" ${oldChatId} → ${newChatId}`,
|
||||
),
|
||||
);
|
||||
runtime.log?.(warn(`[telegram] Group migrated: "${chatTitle}" ${oldChatId} → ${newChatId}`));
|
||||
|
||||
// Check if old chat ID has config and migrate it
|
||||
const currentConfig = loadConfig();
|
||||
@@ -107,11 +103,7 @@ export const registerTelegramHandlers = ({
|
||||
});
|
||||
|
||||
if (migration.migrated) {
|
||||
runtime.log?.(
|
||||
warn(
|
||||
`[telegram] Migrating group config from ${oldChatId} to ${newChatId}`,
|
||||
),
|
||||
);
|
||||
runtime.log?.(warn(`[telegram] Migrating group config from ${oldChatId} to ${newChatId}`));
|
||||
migrateTelegramGroupConfig({ cfg, accountId, oldChatId, newChatId });
|
||||
await writeConfigFile(currentConfig);
|
||||
runtime.log?.(warn(`[telegram] Group config migrated and saved successfully`));
|
||||
@@ -123,15 +115,11 @@ export const registerTelegramHandlers = ({
|
||||
);
|
||||
} else {
|
||||
runtime.log?.(
|
||||
warn(
|
||||
`[telegram] No config found for old group ID ${oldChatId}, migration logged only`,
|
||||
),
|
||||
warn(`[telegram] No config found for old group ID ${oldChatId}, migration logged only`),
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
runtime.error?.(
|
||||
danger(`[telegram] Group migration handler failed: ${String(err)}`),
|
||||
);
|
||||
runtime.error?.(danger(`[telegram] Group migration handler failed: ${String(err)}`));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -54,11 +54,7 @@ export function migrateTelegramGroupConfig(params: {
|
||||
|
||||
const accountGroups = resolveAccountGroups(params.cfg, params.accountId).groups;
|
||||
if (accountGroups) {
|
||||
const result = migrateTelegramGroupsInPlace(
|
||||
accountGroups,
|
||||
params.oldChatId,
|
||||
params.newChatId,
|
||||
);
|
||||
const result = migrateTelegramGroupsInPlace(accountGroups, params.oldChatId, params.newChatId);
|
||||
if (result.migrated) {
|
||||
migrated = true;
|
||||
scopes.push("account");
|
||||
@@ -68,11 +64,7 @@ export function migrateTelegramGroupConfig(params: {
|
||||
|
||||
const globalGroups = params.cfg.channels?.telegram?.groups;
|
||||
if (globalGroups) {
|
||||
const result = migrateTelegramGroupsInPlace(
|
||||
globalGroups,
|
||||
params.oldChatId,
|
||||
params.newChatId,
|
||||
);
|
||||
const result = migrateTelegramGroupsInPlace(globalGroups, params.oldChatId, params.newChatId);
|
||||
if (result.migrated) {
|
||||
migrated = true;
|
||||
scopes.push("global");
|
||||
|
||||
Reference in New Issue
Block a user