1
0
Fork 0
Fully typed my.telegram.org API wrapper https://npmjs.com/package/my.telegram.org-api-wrapper
This repository has been archived on 2025-09-14. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2022-10-30 13:45:19 +04:00
src Logout, isLoggedIn method, getSettings signature update 2022-10-30 13:45:19 +04:00
test Logout, isLoggedIn method, getSettings signature update 2022-10-30 13:45:19 +04:00
.eslintrc.js Builds settings 2022-10-27 23:55:30 +04:00
.gitignore Logout, isLoggedIn method, getSettings signature update 2022-10-30 13:45:19 +04:00
API.md Logout, isLoggedIn method, getSettings signature update 2022-10-30 13:45:19 +04:00
babel.config.js Tests 2022-10-28 01:29:20 +04:00
jest.config.js Find gcm push notification key 2022-10-30 13:17:16 +04:00
LICENSE.md Add LICENSE.md 2022-10-28 01:32:43 +04:00
package-lock.json Logout, isLoggedIn method, getSettings signature update 2022-10-30 13:45:19 +04:00
package.json Logout, isLoggedIn method, getSettings signature update 2022-10-30 13:45:19 +04:00
README.md Logout, isLoggedIn method, getSettings signature update 2022-10-30 13:45:19 +04:00
tsconfig.json Tests 2022-10-28 01:29:20 +04:00

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