nodegin / tglib

TDLib (Telegram Database library) bindings for Node.js
114 stars 16 forks source link

Error: Unable to create client: ENOENT: no such file or directory, open 'my/dir/libtdjson.so #17

Closed mariooc closed 6 years ago

mariooc commented 6 years ago

` const { Client } = require('tglib') async function main() { const client = new Client({ apiId: 'YOUR_API_ID', apiHash: 'YOUR_API_HASH', phoneNumber: 'YOUR_PHONE_NUMBER', })

await client.connect()

const result = await client.fetch({
    '@type': 'getChats',
    'offset_order': '9223372036854775807',
    'offset_chat_id': 0,
    'limit': 100,
})

// latest 100 chats will be returned
console.log(result)

}

main()`

nodegin commented 6 years ago

Please double check your binary path is correct.

mariooc commented 6 years ago

├── index.js ├── node_modules │   ├── ansi-escapes │   ├── ansi-regex │   ├── ansi-styles │   ├── bindings │   ├── chalk │   ├── chardet │   ├── cli-cursor │   ├── cli-width │   ├── color-convert │   ├── color-name │   ├── debug │   ├── escape-string-regexp │   ├── external-editor │   ├── ffi-napi │   ├── figures │   ├── get-symbol-from-current-process-h │   ├── get-uv-event-loop-napi-h │   ├── has-flag │   ├── iconv-lite │   ├── inquirer │   ├── is-fullwidth-code-point │   ├── is-promise │   ├── lodash │   ├── mimic-fn │   ├── ms │   ├── mute-stream │   ├── node-addon-api │   ├── onetime │   ├── os-tmpdir │   ├── ref-napi │   ├── ref-struct-di │   ├── restore-cursor │   ├── run-async │   ├── rxjs │   ├── safer-buffer │   ├── signal-exit │   ├── string-width │   ├── strip-ansi │   ├── supports-color │   ├── symbol-observable │   ├── tglib │   ├── through │   ├── tmp │   └── uuid ├── package.json └── package-lock.json

index.js

` const { Client } = require('tglib')

async function main() {
    const client = new Client({
        apiId       : 'YOUR_API_ID',
        apiHash     : 'YOUR_API_HASH',
        phoneNumber : 'YOUR_PHONE_NUMBER',
    })

    await client.connect()

    const result = await client.fetch({
        '@type'          : 'getChats',
        'offset_order'   : '9223372036854775807',
        'offset_chat_id' : 0,
        'limit'          : 100,
    })

    // latest 100 chats will be returned
    console.log(result)
}

main()

`

nodegin commented 6 years ago

You have to compile the binary yourself.

Getting started

Build the binary (https://github.com/tdlib/td#building)