/yvt-bot

A bot that reposts VK posts to Telegram

Primary LanguageTypeScript

VK Telegram bot reposter

A bot that reposts VK group posts to Telegram channel. Bot uses serverless components of Yandex Cloud.

Yandex Services

Tools

Prerequisites

We assume that you already have Yandex Cloud account with created cloud and folder

Installation

  • npm install
  • yc init
  • npm run setup-vars
  • Pass VK and Telegram variables into terraform.tfvars
  • terraform init
  • npm run build
  • npm run deploy
  • Copy entry_url from console output or from Yandex Cloud API Gateway Domain and paste in your VK group Settings -> API Usage -> Callback API -> URL. Set ✓ in Event Types -> Posts -> New

HOWTO

How to get Telegram channel id

  • Click on @jsondumpbot or search for JSON Dump Bot on Telegram
  • Forward a message from your Telegram channel to the JsonDumpBot telegram bot and you should see something like this:
"forward_from_chat": {
    "id": -10012312312313,
    "title": "some_chat_title",
    "username": "some_username",
    "type": "channel"
}

How to create Telegram bot and get token

How to setup local environment

  • Edit .env file with your variables
  • You can get AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, DOCAPI_ENDPOINT and YMQ_QUEUE_URL from Outputs after deploy or you can open any of yours functions in Yandex Cloud and them from there