tdl
tdl copied to clipboard
updateNewChat is emitting random chats that I'm not receiving
` import dotenv from "dotenv"; import * as tdl from 'tdl'; import { getTdjson } from 'prebuilt-tdlib'; dotenv.config();
const TELEGRAM_API_ID = process.env.TELEGRAM_API_ID ?? '0'; const TELEGRAM_API_HASH = process.env.TELEGRAM_API_HASH ?? ''; const TELEGRAM_PHONE = process.env.TELEGRAM_PHONE ?? '';
tdl.configure({ tdjson: getTdjson() }) const client = tdl.createClient({ apiId: parseInt(TELEGRAM_API_ID), // Your api_id apiHash: TELEGRAM_API_HASH // Your api_hash
})
client.on('error', console.error)
client.on('update', async update => { const { _ } = update if (_ === 'updateNewChat') { const { id, title } = update.chat console.log(id, title) } })
export async function startTelegramClient() { await client.login({ getPhoneNumber: async () => TELEGRAM_PHONE }) } `
as the title suggest I am receiving updateNewChats but of random people who's not chatting with me