We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` 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
The text was updated successfully, but these errors were encountered:
No branches or pull requests
`
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
The text was updated successfully, but these errors were encountered: