vk-to-telegram
Advanced tools
Comparing version 0.0.9 to 0.0.10
20
app.js
@@ -37,3 +37,3 @@ | ||
vkPost(myObj.object, () => { | ||
if (!!myObj.object.copy_history) { | ||
if (myObj.object.copy_history) { | ||
let cophhis = myObj.object.copy_history, | ||
@@ -51,3 +51,3 @@ last = cophhis.length - 1 | ||
let mediaText | ||
//console.log(media) // Debug here | ||
console.log(media) // Debug here | ||
if (media.text) { | ||
@@ -68,3 +68,3 @@ mediaText = media.text | ||
//console.log(mediaText) | ||
if (!!media.attachments) { // Post generator start | ||
if (media.attachments) { // Post generator start | ||
media = media.attachments | ||
@@ -223,3 +223,3 @@ let array = [], | ||
if (mediaText) { | ||
bot.telegram.sendMessage(allParams.chatid, mediaText, { | ||
bot.telegram.sendMessage(allParams.chatid, `<a>${mediaText}</a>`, { | ||
reply_markup: yes ? keyboardStr : '', | ||
@@ -286,2 +286,3 @@ disable_web_page_preview: true, | ||
}).then(() => { | ||
yes = false | ||
i++ | ||
@@ -296,2 +297,3 @@ mediaPoster() | ||
}).then(() => { | ||
yes = false | ||
i++ | ||
@@ -304,3 +306,3 @@ mediaPoster() | ||
case 'album': | ||
keyboardStr = { | ||
let keyboard = { | ||
inline_keyboard: [ | ||
@@ -314,3 +316,3 @@ [{ | ||
bot.telegram.sendPhoto(allParams.chatid, helps.getImgRes(media[i].album.thumb), { | ||
reply_markup: keyboardStr | ||
reply_markup: keyboard | ||
}).then(() => { | ||
@@ -329,8 +331,6 @@ i++ | ||
if (mediaText) { | ||
bot.telegram.sendMessage(allParams.chatid, mediaText, { | ||
bot.telegram.sendMessage(allParams.chatid, `<a>${mediaText}</a>`, { | ||
parse_mode: 'HTML', | ||
disable_web_page_preview: false | ||
}).then(() => { | ||
output() | ||
}) | ||
}).then(output()) | ||
} else { | ||
@@ -337,0 +337,0 @@ output() |
{ | ||
"name": "vk-to-telegram", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Vk to telegram forwarder", | ||
@@ -5,0 +5,0 @@ "author": "ejnshtein", |
# vk to telegram forwarder | ||
Powered by [Telegraf](https://github.com/telegraf/telegraf) | ||
## What is this? | ||
It is a tool for express who via using VK callback api group forwards posts in channel or chat in Telegram! | ||
It is a tool for express which using [VK callback api](https://vk.com/dev/callback_api) forwards posts from group in channel or chat in Telegram! | ||
Be careful, it doesn't send **audio and poll's**(maybe fix soon). | ||
## Where I can see how it looks? | ||
For example, this code sending posts from [Tavern of Heroes | Overwatch](https://vk.com/tavernofoverwatch) to Telegram channel [Tavern of Overwatch | News](https://t.me/tavernofoverwatchnews); | ||
from [Oleg Livanov - One man army](https://vk.com/oleglivanovgaming) trought Heroku to Telegram channel [Oleg Livanov - One man army](https://t.me/oleglivanovgaming) | ||
For example, this sending posts from [Tavern of Heroes | Overwatch](https://vk.com/tavernofoverwatch) to Telegram channel [Tavern of Overwatch | News](https://t.me/tavernofoverwatchnews), | ||
[Oleg Livanov - One man army](https://vk.com/oleglivanovgaming) trought [Heroku](https://heroku.com/) to Telegram channel [Oleg Livanov - One man army](https://t.me/oleglivanovgaming) | ||
## Installation | ||
@@ -42,3 +42,3 @@ npm install vk-to-telegram@latest --save | ||
|||https://oauth.vk.com/authorize?client_id=YOUR APPLICATION ID&display=page&redirect_uri=http://vk.com/&scope=offline,video,docs&response_type=token&v=5.73| | ||
|||4. Click allow all that need's and it's all! Your token is in query url, do not copy all link, only token without other params!!! | | ||
|||4. Click allow all that need's and it's all! Your token is in query url, do not copy all link, only token without other params. | | ||
|`fromId` | Optional | VK group id with '-'in start or nothing, if you don't need check. | | ||
@@ -50,1 +50,5 @@ | ||
Also, I have an idea to add discord channel support, but it's just idea. ᕦ( ͡° ͜ʖ ͡°)ᕤ | ||
### Contact | ||
Here's a telegram group ¯\\_(ツ)_/¯ https://t.me/vktotgforwarder | ||
Also u can write to me directly in [Telegram](https://t.me/ejnshtein) or by [mail](mailto:ejnshtein@dsgstng.com) |
65091
52