How to use the tdweb/dist/tdweb function in tdweb

To help you get started, we’ve selected a few tdweb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github evgeny-nadymov / telegram-react / src / Controllers / TdLibController.js View on Github external
logVerbosityLevel: verbosity,
                jsLogVerbosityLevel: jsVerbosity,
                mode: mode, // 'wasm-streaming'/'wasm'/'asmjs'
                prefix: useTestDC ? 'tdlib_test' : 'tdlib',
                readOnly: readOnly,
                isBackground: false,
                useDatabase: useDatabase,
                wasmUrl: `${WASM_FILE_NAME}?_sw-precache=${WASM_FILE_HASH}`
                // onUpdate: update => this.emit('update', update)
            };

            console.log(
                `[TdLibController] (fast_updating=${fastUpdating}) Start client with params=${JSON.stringify(options)}`
            );

            this.client = new TdClient(options);
            this.client.onUpdate = update => {
                if (!this.disableLog) {
                    if (update['@type'] === 'updateFile') {
                        console.log('receive updateFile file_id=' + update.file.id, update);
                    } else {
                        console.log('receive update', update);
                    }
                }
                this.emit('update', update);
            };
        });
    };

tdweb

JavaScript interface for TDLib (Telegram library)

BSL-1.0
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular tdweb functions