Trivial AWS Lambda + AWS CloudWatch application designed to forward VK posts to the public channel using CRON job
- Create VK application here
- Platform:
Website
- Website:
<project_id>.appspot.com
- Copy Service token from the settings in the newly created app,
<vk_token>
in the config file
- Platform:
- Create a new Telegram bot with BotFather and copy provided token,
<tg_token>
in the config and cron files - Create a new public channel in telegram and add this bot as an admin to this channel (
<@channelname>
in the config file) - Clone repository:
git clone https://github.com/Meosit/VK-TG-Forwarder.git cd VK-TG-Forwarder
- Fill the
config.json
with all the credentials and list of community ids - Create a zip file with the bot code
zip -0 lambda.zip config.py config.json main.py tg_request_mapper.py vk_wall_fetcher.py
- Create AWS Lambda Function triggered by AWS EventBridge scheduled rule
0. Go to AWS Lambda Console and create Python 3.9 runtime function
0. Upload
lambda.zip
file to the lambda and set the Handler field tomain.update_feed
0. At the Designer, press 'Add trigger' button, selectEventBridge (CloudWatch Events)
and create a new rule with the following schedule expression:rate(10 minutes)
- Supported attachment types:
photo
,gif
,video
,poll
- Each post contains a link to the original message
- Only gif and photos are sent natively into the telegram, the rest of the content represented as text
- VK has only its own video links available from the API (even if it's a youtube video)