eilvelia / tdl

Node.js bindings to TDLib 🥒
MIT License
394 stars 52 forks source link

updateNewChat is emitting random chats that I'm not receiving #160

Open lexermekongnet opened 3 months ago

lexermekongnet commented 3 months ago

` 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