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

vk-to-telegram

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vk-to-telegram - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.vscode/launch.json

22

index.js

@@ -75,17 +75,25 @@ const forward = require('./lib/forwarder')

}
if (this.debug) { util.log(herokuPosts) }
if (this.heroku) {
const newPost = { id: body.object.id, date: Date.now() }
if (herokuPosts[body.group_id] && herokuPosts[body.group_id].length > 0) {
herokuPosts[body.group_id] = herokuPosts[body.group_id].filter(el => Date.now() - el.date < this.herokuTimeout)
const post = herokuPosts[body.group_id].find(el => el.id === body.object.id)
if (herokuPosts[body.group_id] && Object.keys(herokuPosts[body.group_id]).length > 0) {
for (const id in herokuPosts[body.group_id]) {
const post = herokuPosts[body.group_id][id]
if (Date.now() - post.date > this.herokuTimeout) {
delete herokuPosts[body.group_id][id]
}
}
const post = herokuPosts[body.group_id][newPost.id]
if (post) {
return reject(`Double post detected ${JSON.stringify(body.object)}`)
} else {
herokuPosts[body.group_id].push(newPost)
herokuPosts[body.group_id][newPost.id] = { date: newPost.date }
}
} else {
herokuPosts[body.group_id] = [newPost]
herokuPosts[body.group_id] = {
[newPost.id]: { date: newPost.date }
}
}
}
console.log(herokuPosts)
if (this.debug) { util.log(herokuPosts) }
telegram = new Telegram(this.token)

@@ -114,3 +122,3 @@ vkapi = vkApi(this.vkToken)

} else {
return null
return forwarder(body.object)
}

@@ -117,0 +125,0 @@ } else {

{
"name": "vk-to-telegram",
"version": "0.1.0",
"version": "0.1.1",
"description": "Vk to telegram forwarder",

@@ -5,0 +5,0 @@ "author": "ejnshtein",

@@ -17,2 +17,3 @@ const vkToTelegram = require('./index'),

})
vkToTg.debug = true
// vkToTg.debug = true

@@ -26,3 +27,3 @@ app.use(bodyParser.json())

.catch(err => {
console.log(err)
console.log('err:',err)
})

@@ -29,0 +30,0 @@ })

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