PHP code example of yc-open / midjourney
1. Go to this page and download the library: Download yc-open/midjourney 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/ */
yc-open / midjourney example snippets
cOpen\Midjourney\Service;
# 频道ID
$discord_channel_id = '';
# 用户TOKEN
$discord_user_token = '';
$config = [
'channel_id' => $discord_channel_id,
'oauth_token' => $discord_user_token,
'timeout'=> 30, # 超时时间[README.md](..%2F..%2FPHP-midjourney-proxy%2FREADME.md)
];
$midjourney = new Service($config);
$response = $midjourney->imagine('Pink Panda');
print_r($response);