mtcute/packages/node
2024-03-07 05:35:37 +03:00
..
src chore: worker 2024-03-07 05:35:36 +03:00
build.config.cjs build: extracted custom build config to packages themselves 2023-11-02 21:23:17 +03:00
package.json chore: sideeffects: false in the rest of the packages 2024-03-07 05:35:37 +03:00
README.md docs: updated readmes 2024-03-07 05:35:37 +03:00
tsconfig.json chore!: started extracting platform-specific stuff into separate packages 2024-03-07 05:35:36 +03:00
typedoc.cjs docs: updated readmes 2024-03-07 05:35:37 +03:00

@mtcute/node

📖 API Reference

Node.js support package for mtcute. Includes:

  • Support for native crypto addon (must be installed separately, @mtcute/crypto-node)
  • Terminal I/O via readline
  • SQLite storage (@mtcute/sqlite)
  • TCP transport
  • TelegramClient implementation using the above
  • HTML and Markdown parsers

Usage

import { TelegramClient } from '@mtcute/node'

const tg = new TelegramClient({
    apiId: 12345,
    apiHash: 'abcdef',
    storage: 'my-account'
})

tg.run(async (user) => {
    console.log(`✨ logged in as ${user.displayName}`)
})