ferranfg / midjourney-discord-api-php

Generate images using Midjourney Bot through the Discord API.
https://ferranfigueredo.com
MIT License
135 stars 35 forks source link

started getting an error #30

Open myindexlike opened 10 months ago

myindexlike commented 10 months ago

"{"data": ["\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u0430. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0443 \u043c\u0438\u043d\u0443\u0442."]}"

{"data": ["Команда больше не действительна. Повторите попытку через пару минут."]}

tanghengzhi commented 10 months ago

the same error

BA7YA commented 10 months ago

@tanghengzhi @myindexlike Did you find solution for this problem?

myindexlike commented 10 months ago

batdan/midjourney-api-php

BA7YA commented 10 months ago

I found the problem. It's related to dataVersion variable. That was changed. You can use following code to get current version without hardcode

$response = self::$client->get('applications/' . self::APPLICATION_ID . '/commands');
        $body = $response->getBody()->getContents();
        $json = json_decode($body, true);

        $this->data_id       = $json[0]['id'];
        $this->data_version  = $json[0]['version'];
mamislimen commented 10 months ago

the same error

andriiinoxtech commented 5 months ago

This lib is dead and can not be used anymore. The answer about the data_version is correct but author made this lib in the way that gives you zero chanse to fix it. Because the version is defigned by a private constant and you can not modify it by any trick. Only by hardcode directly in the vendor folder. That means you can't normally use it and need or fork or rewrite the same from scratch.