my.telegram.org-api-wrapper
v1.1.0
Published
Fully typed my.telegram.org API wrapper
Downloads
1
Maintainers
Readme
my.telegram.org API wrapper
TypeScript supported! Tested with Jest!
Features
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!!!
Motivation
Ask your mama
Installation
npm i my.telegram.org-api-wrapper
yarn add my.telegram.org-api-wrapper
Usage
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
)
API Reference
Tests
Fill test/.env file with PHONE
and optionally SESSION_TOKEN
. Then run npm test
.
Behind the scenes
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).