Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

plaintl

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plaintl

A plain telegram listener

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

PlainTL

A plain telegram listener based on GramJS

Installation

# npm
npm i plaintl

# yarn
yarn add plaintl
// esm
import { startSession, eventEmitter } from "plaintl"

// cjs
const { startSession, eventEmitter } = require("plaintl")

Usage

Listen to Requires events and then submit your values with emitter functions. (only for the first session)

eventEmitter
    .on("RequiresPhoneNumber", (phoneNumberEmitter) => {
        phoneNumberEmitter("+989990009999")
    })
    .on("RequiresPhoneCode", (phoneCodeEmitter) => {
        phoneCodeEmitter("550055")
    })
    .on("RequiresPassword", (passwordEmitter) => {
        passwordEmitter("password")
    })
    .on("RequiresFirstAndLastNames", (firstAndLastNamesEmitter) => {
        firstAndLastNamesEmitter(["First name", "Last name"])
    })

Preparing provider options.

Obtain API_ID and API_HASH from here.

const providerOptions = {
    apiId: "API_ID",
    apiHash: "API_HASH",
    forceSMS: false,
}

Start PlainTL session.

// async
const listener = await startSession(providerOptions)

// sync
startSession(providerOptions).then((listener) => {})

Listen to Telegram Update events.

listener.on("UpdateShortMessage", (event) => {
    console.log(event)
})

Cli

# npm
npx plaintl

# github
npx github:dalirnet/plaintl

Update events

Keywords

FAQs

Package last updated on 15 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc