diff --git a/bot/src/tdlib/client.ts b/bot/src/tdlib/client.ts index 1b3fb64..e4485c8 100644 --- a/bot/src/tdlib/client.ts +++ b/bot/src/tdlib/client.ts @@ -38,6 +38,20 @@ export async function createBotClient(): Promise { })); log.info("Bot client authenticated successfully"); + + // Load chat list so TDLib knows about channels the bot has access to. + // Without this, forwardMessages/copyMessage will fail with "Chat not found". + try { + await client.invoke({ + _: "getChats", + chat_list: { _: "chatListMain" }, + limit: 200, + }); + log.info("Chat list loaded"); + } catch (err) { + log.warn({ err }, "Failed to load chat list — forwarding may fail"); + } + return client; }