PHP code example of onebot / libonebot
1. Go to this page and download the library: Download onebot/libonebot library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
onebot / libonebot example snippets
declare(strict_types=1);
epl', 'qq', 'REPL-1');
$ob->setLogger(new \OneBot\Logger\Console\ConsoleLogger());
$ob->setDriver(
// 此处也可以在 Linux 系统下安装 swoole 扩展后使用 SwooleDriver() 拥有协程能力
new \OneBot\Driver\Workerman\WorkermanDriver(),
new \OneBot\Config\Repository('demo.json')
);
$ob->setActionHandlerClass(\OneBot\V12\Action\ReplAction::class);
$ob->run();
bash
# 运行 OneBot 实现
php demo.php