my.telegram.org API wrapper
TypeScript supported! Tested with Jest!
Do anything you usually do at my.telegram.org but hacker-stylish (hackerlish-like). From JS. From command line. Use it as CLI. Use it in your cron. Embed it in your paid software and tell your coworkers you made this library yourself because it's just 1.32 kB gzipped!!!
Ask your mama
npm i my.telegram.org-api-wrapper
yarn add my.telegram.org-api-wrapper
import MyTelegramOrg from 'my.telegram.org-api-wrapper'
const myTelegramOrg = new MyTelegramOrg()
await myTelegramOrg.sendCode('+79019404698')
// Read code from user's input
await myTelegramOrg.loginWithCode(code)
const tokens = await myTelegramOrg.obtainTokens()
console.log(
tokens.app.api_id,
tokens.app.api_hash
)
Fill test/.env file with PHONE
and optionally SESSION_TOKEN
. Then run npm test
.
I wrote most of the code myself, but then I found MadelineProto and stole createApp
method from there, so credits goes to the author. Anyway, code is written by me so license is MIT (if you really care about licenses when abusing private API).