aidsoul / botpvt
This package is abandoned and no longer maintained.
No replacement package was suggested.
1.1.2
2022-03-30 09:58 UTC
Requires
- php: >=8
- gabordemooij/redbean: ^v5.7.1
- longman/telegram-bot: ^0.74.0
This package is auto-updated.
Last update: 2023-09-29 02:47:15 UTC
README
New versions available here: https://github.com/aidsoul/vktote
Installation
To install, use the command: git clone https://github.com/aidsoul/vk-to-telegram
.
Download the necessary libraries using the command: composer install
.
Or use command composer require aidsoul/botpvt
.
Connection example
require_once __DIR__.'/vendor/autoload.php'; $config = [ 'Vk' =>[ 'token' => 'Your token', 'idGroup' => 'Group id or name', 'count' => 5 ], 'Telegram' =>[ 'botApiKey' => '', 'botName' => '', 'chatId' => 0 ], 'Db' =>[ 'host' => 'mysql:host=localhost', 'dbName' => 'vk', 'user' => 'root', 'pass' => '' ], ]; Botpvt\Start::vk($config);
Widgets
require_once __DIR__.'/vendor/autoload.php'; use Botpvt\Config\Config; // Combining all widgets into text and pinning in the channel /**/ Config::set($config); $con = new Botpvt\Widgets\Conclusion; $con->push();
If you need to send only a specific widget, use:
$widget = Botpvt\Widgets\ExchangeRate; // get a string with the answer $str = $widget->get();
This method does not send data to the telegram channel!
MySQL
The project uses a mysql database.
And finally, import the database file: db.sql
.
Task Scheduler
Use crontab on your server or another task scheduler to get fresh posts without stopping.
Usage example
Open and add a task to the task list: crontab-e
.
Get fresh entries every minute: * * * * * php /patch for php file
.