Skip to content

mortezaataiy/nodejs-tdlib-login-example

Repository files navigation

A simple example of TDLib (Telegram Database Library) authentication using tdl (Node.js package)

User login information (phone number and authentication code) gets by Telegram API Bot.

After successfully logging in, if you send "Ping" in your saved messages, you will see that "Pong" sent automatically.

TDLib nodejs authentication example

Table of Contents


Getting started

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

You can also use prebuilt binaries: tdlib.native

  1. git clone https://github.com/mortezaataiy/nodejs-tdlib-login-example.git
  2. initial config.js file (like config-example.js)
  3. npm install
  4. npm start

Test

  1. Send /start in your Api bot (that you set token in config file)
  2. The bot want you to send phone number like this:

/send c+123456789012

char 'c' need!

  1. The bot want you to send auth code like this: (The code that Telegram send you for log in)

/send c12345

char 'c' need! (if send code without a char with telegram the code has expired!)

  1. The bot want you to send password like this if needed: (If Two-Step Verification is actived)

/send c12345

char 'c' need!

  1. Now you receive "Ready" and now you can test cli bot with:

  2. Send Ping in saved messages in your telegram account like gif

  3. you will see that "Pong" sends automatically :)

If you have a problem, send an issue

About

TDLib (Telegram Database library) authentication example use Node.js (Bannerets/tdl)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published