Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alcortazzo/vktgbot
πΊπ¦ Telegram Bot for reposting from VKontakte to Telegram channel
https://github.com/alcortazzo/vktgbot
bot parser pytelegrambotapi python python3 telegram telegram-bot vk-api vkontakte vkontakte-api
Last synced: 5 days ago
JSON representation
πΊπ¦ Telegram Bot for reposting from VKontakte to Telegram channel
- Host: GitHub
- URL: https://github.com/alcortazzo/vktgbot
- Owner: alcortazzo
- License: gpl-3.0
- Archived: true
- Created: 2020-04-13T07:57:36.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-19T11:51:02.000Z (about 1 year ago)
- Last Synced: 2024-10-09T18:21:28.937Z (4 months ago)
- Topics: bot, parser, pytelegrambotapi, python, python3, telegram, telegram-bot, vk-api, vkontakte, vkontakte-api
- Language: Python
- Homepage:
- Size: 633 KB
- Stars: 129
- Watchers: 14
- Forks: 37
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
vktgbot
Telegram bot for automatic forwarding posts from VK to Telegram.
## About
Python script to automatically repost from VK community pages to Telegram channels or chats. Once the script is set up and running, it will check for new posts in VK every *N* seconds using VK API and, if there are any, parse and send them to Telegram.
## How to use the script
You can manually run the script with Python or Docker and leave it running in the background. Or you can set the script to run automatically on the remote server with tools like crontab, systemd, etc. Or you can configure the script to run at one time if you set `VAR_SINGLE_START = True` in `.env` file.
## Installation
```shell
# clone the repository
$ git clone https://github.com/alcortazzo/vktgbot.git# if you want to clone specific version (for example v2.6)
$ git clone -b v2.6 https://github.com/alcortazzo/vktgbot.git# change the working directory to vktgbot
$ cd vktgbot
```
*Note that in version 3.0 the script has been rewritten from the [pyTelegramBotAPI](https://github.com/eternnoir/pyTelegramBotAPI) library to the [aiogram](https://github.com/aiogram/aiogram) library. So if you want to install an older version of the script working with the pyTelegramBotAPI library, install version 2.6 using the method above. You can find instructions on how to run an older version of the script [here](https://github.com/alcortazzo/vktgbot/tree/v2.6).*## Configuring
**Open `.env` configuration file with text editor and set the following variables:**
```ini
VAR_TG_CHANNEL = @aaaa
VAR_TG_BOT_TOKEN = 1234567890:AAA-AaA1aaa1AAaaAa1a1AAAAA-a1aa1-Aa
VAR_VK_TOKEN = 00a0a0ab00f0a0ab00f0a6ab0c00000b0f000f000f0a0ab0a00b000000dd00000000de0
VAR_VK_DOMAIN = bbbb
```
* `VAR_TG_CHANNEL` is link or ID of Telegram channel. **You must add bot to this channel as an administrator!**
* `VAR_TG_BOT_TOKEN` is token for your Telegram bot. You can get it here: [BotFather](https://t.me/BotFather).
* `VAR_VK_TOKEN` is personal token for your VK profile. You can get it here: [HowToGet](https://github.com/alcortazzo/vktgbot/wiki/How-to-get-personal-access-token).
* `VAR_VK_DOMAIN` is part of the link (after vk.com/) to the VK channel. For example, if link is `vk.com/durov`, you should set `VAR_VK_DOMAIN = durov`.**Open the file "last_id.txt" and write in it the ID of the last message (not the pinned one!):**
* For example, if the link to post is `https://vk.com/wall-22822305_1070803`, then the id of that post will be `1070803`.
* [Example photo](https://i.imgur.com/eWpso0C.png)## Running
### Using Python
```shell
# install requirements
$ python3 -m pip install -r requirements.txt# run script
$ python3 vktgbot
```
### Using Docker
```shell
# change the working directory to docker
$ cd docker# build and run docker
$ docker-compose up --build
```
## License
GPLv3
Original Creator - [alcortazzo](https://github.com/alcortazzo)