my.telegram.org-api-wrapper

1.1.0 • Public • Published

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

Read API reference here

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).

Donate. Do it right now. ⤵️

hloth.dev/donate

Package Sidebar

Install

npm i my.telegram.org-api-wrapper

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

8.01 kB

Total Files

4

Last publish

Collaborators

  • vityaschel