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 - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

18

cli.js

@@ -7,14 +7,8 @@ #!/usr/bin/env node

/**
* Setting default env from public data on github
* Setting default API_ID and API_HASH from public data on github
* https://github.com/zhukov/webogram/blob/master/app/js/lib/config.js
*/
process.env.API_ID = "2496"
process.env.API_HASH = "8da85b0d5bfe62527e5b244c209159c3"
const API_ID = 2496
const API_HASH = "8da85b0d5bfe62527e5b244c209159c3"
startSession().then((listener) => {
listener.on("UpdateShortMessage", (event) => {
console.log(event)
})
})
eventEmitter

@@ -36,1 +30,7 @@ .on("RequiresPhoneNumber", (phoneNumberEmitter) => {

})
startSession({ apiId: API_ID, apiHash: API_HASH }).then((listener) => {
listener.on("UpdateShortMessage", (event) => {
console.log(event)
})
})
{
"name": "plaintl",
"version": "1.0.2",
"version": "1.0.3",
"description": "A plain telegram listener",

@@ -32,7 +32,7 @@ "main": "./src/index.mjs",

"dependencies": {
"dotenv": "^12.0.3",
"input": "^1.0.1",
"telegram": "^2.3.0",
"envfile": "^6.17.0",
"lodash": "^4.17.21"
"lodash": "^4.17.21",
"telegram": "^2.3.0"
}
}

@@ -23,13 +23,2 @@ # PlainTL

### Preparation
Rename `.sample.env` to `.env` and then set your environment values.
```bash
API_ID="YOUR_API_ID"
API_HASH="YOUR_API_HASH"
```
Obtain `API_ID` and `API_HASH` from [here](https://my.telegram.org/auth).
### Usage

@@ -48,6 +37,21 @@

.on("RequiresPassword", (passwordEmitter) => {
passwordEmitter("my-password")
passwordEmitter("password")
})
.on("RequiresFirstAndLastNames", (firstAndLastNamesEmitter) => {
firstAndLastNamesEmitter(["First name", "Last name"])
})
```
Preparing provider [options](https://github.com/dalirnet/plaintl/blob/main/src/index.mjs#L117-L120).
> Obtain `API_ID` and `API_HASH` from [here](https://my.telegram.org/auth).
```javascript
const providerOptions = {
apiId: "API_ID",
apiHash: "API_HASH",
forceSMS: false,
}
```
Start `PlainTL` session.

@@ -57,6 +61,6 @@

// async
const listener = await startSession()
const listener = await startSession(providerOptions)
// sync
startSession().then((listener) => {})
startSession(providerOptions).then((listener) => {})
```

@@ -63,0 +67,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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