Changelog
tdl@8.0.2 (2024-12-20)
TypeError: null is not an object
error in client.login()
if called from a database with an incomplete login attempt.Changelog
tdl@8.0.1 (2024-06-18)
receiveTimeout
) seconds.This is related to bun < v1.1.14 only.
Changelog
tdl@8.0.0 (2024-05-28)
tdl-tdlib-addon
is removed. The Client
constructor
is no longer exported. The non-deprecated API mostly remains the same.useNewTdjsonInterface
option in tdl.configure
is removed; useOldTdjsonInterface
is added
instead.client.iterUpdates()
to receive updates via async iterators as an
alternative to client.on('update', ...)
. Example:
for await (const update of client.iterUpdates()) {
if (update._ === 'updateOption' && update.name === 'my_id') {
console.log(`My ID is ${update.value.value}!`)
break
}
}
client.login()
can now accept the object directly besides a function
returning the object.TDLibError
class; TdlError
is removed and replaced with UnknownError
.client.isClosed()
.receiveTimeout
, useDefaultVerbosityLevel
,
disableAuth
, useMutableRename
, verbosityLevel
.bare
client option. tdl.createBareClient(): Client
is added
instead.destroy
, pause
, resume
, connect
,
connectAndLogin
, getBackendName
, setLogFatalErrorCallback
.TDL
, Tdl
.response
, auth-needed
, auth-not-needed
. The
destroy
event is renamed to close
.client.off
now returns boolean
instead of void
; the once
parameter is
removed. (The eventemitter3
dependency is also dropped.)node:worker_threads
now.--provenance
.tdl
client code was rewritten in TypeScript.Changelog
tdl@7.4.1 (2024-02-16)
tdl@7.4.1-beta.0
on 2023-11-07.Changelog
tdl@7.4.0 (2023-10-10)
tdl.setLogMessageCallback
that allows to pass a callback to the
td_set_log_message_callback
TDLib function using Node-API's thread-safe
functions. (TDLib v1.8.0+ only)tdl.configure
: Added an experimental option useNewTdjsonInterface
that
enables the use of td_create_client_id
/td_send
/td_receive
/td_execute
interface with a client manager and global receive loop, though the old
interface still works well. (TDLib v1.7.0+ only)UV_THREADPOOL_SIZE
clients is lifted.tdl.configure
: Added a receiveTimeout
advanced option.tdl.createClient
: receiveTimeout
in the client options is deprecated.tdl.createClient
: Deprecated the useMutableRename
advanced option.Changelog
tdl@7.3.2 (2023-09-21)
Symbol not found: node_register_module_v…
errors on some platforms.tdl.configure
.Changelog
tdl@7.3.1 (2023-06-22)
This update introduces some significant and long-planned changes to the interface, while retaining backward compatiblity.
tdl
and tdl-tdlib-addon
; just install
tdl
. tdl-tdlib-addon
is deprecated. The library is mostly focused to
Node.js only now, deno support can be added later as a separate library. This
simplifies tdl.configure
function, and execute
is decoupled from clients. As an example:
const tdl = require('tdl')
tdl.configure({
tdjson: 'libtdjson.dylib',
libdir: '/usr/local/lib',
verbosityLevel: 3 /* the default is 2 */
})
tdl.execute({ _: 'setLogStream', /* ... */ })
const client = tdl.createClient({
apiId: /* your api id */,
apiHash: /* your api hash */
})
await client.login()
The full documentation for the configure
function is available in the
TypeScript typings. The old new Client
approach is still supported but
deprecated.verbosityLevel
client option is deprecated (moved to tdl.configure
).prebuildify
and node-gyp-build
.tdl-tdlib-wasm
and tdl-shared
are deprecated. Any webassembly
support is removed.Client#getBackendName
.Old code:
const { Client } = require('tdl')
const { TDLib } = require('tdl-tdlib-addon')
const client = new Client(new TDLib('path/to/libtdjson'), {
apiId,
apiHash,
verbosityLevel: 0,
// ...
})
New code:
const tdl = require('tdl')
tdl.configure({ tdjson: 'path/to/libtdjson', verbosityLevel: 0 })
const client = tdl.createClient({
apiId,
apiHash,
// ...
})
If the default values of tdjson
and verbosityLevel
are used, then calling
configure
is optional.