midjourney-api icon indicating copy to clipboard operation
midjourney-api copied to clipboard

Failed to get application_commands for command settings

Open JoSanson opened this issue 1 year ago • 39 comments

the code that reproduces this issue or a replay of the bug

Failed to get application_commands for command settings

Describe the bug

Describe the bug A clear and concise description of what the bug is.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

error log

Failed to get application_commands for command settings / RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: 0

I haven't changed anything in my code, I generated a new SALAI TOKEN and updated in my environment variables. Everything was working at 2:30 PM and it stopped working at 11:00 PM without any code updates. I just want to know if other people are having the same issue? Thank you in advance!

JoSanson avatar Feb 22 '24 22:02 JoSanson

yes, me too...

ynonra avatar Feb 22 '24 22:02 ynonra

same here. was working fine a moment ago.

faridulreza avatar Feb 22 '24 22:02 faridulreza

It doesn't smell very good... I don't want to panic, but considering that the project hasn't been updated in a while, if there have been any changes on discord's or midjourney's end, it might never be updated... Have you found any alternative solutions?

JoSanson avatar Feb 22 '24 22:02 JoSanson

same issue here

stremblayiOS avatar Feb 22 '24 23:02 stremblayiOS

Me too... allCommand() return empty result : { "applications": [], "application_commands": [], "cursor": { "previous": null, "next": null, "repaired": false } }

morganfuchs avatar Feb 22 '24 23:02 morganfuchs

Seems discord has deprecated this API due to some security reasons?

Germey avatar Feb 23 '24 01:02 Germey

Same

mpakunderscore avatar Feb 23 '24 02:02 mpakunderscore

same

windjet avatar Feb 23 '24 02:02 windjet

I've opened a pull request with a provisional workaround. Meanwhile, @freezer71 has created interim npm package freezer-midjourney-api

deniska83 avatar Feb 23 '24 02:02 deniska83

I've opened a pull request with a provisional workaround. Meanwhile, @freezer71 has created interim npm package freezer-midjourney-api

hi. Can you clarify how to fix it? I have tried installing the package, but the problem still hasn't been resolved.

E-toolmaster avatar Feb 23 '24 03:02 E-toolmaster

I've opened a pull request with a provisional workaround. Meanwhile, @freezer71 has created interim npm package freezer-midjourney-api

hi. Can you clarify how to fix it? I have tried installing the package, but the problem still hasn't been resolved.

You should be using

import { Midjourney } from 'freezer-midjourney-api';

instead of

import { Midjourney } from 'midjourney';

For this particular problem to go away.

Remember to check the original package for a permanent fix!

deniska83 avatar Feb 23 '24 03:02 deniska83

The discord api v9 seems give null response for "application_commands" now.

https://discord.com/api/v9/channels/1105325796748439578/application-commands/search?type=1&query=settings&limit=1&include_applications=true

{ "applications": [], "application_commands": [], "cursor": { "previous": null, "next": null, "repaired": false } }

Jiancong avatar Feb 23 '24 03:02 Jiancong

I've opened a pull request with a provisional workaround. Meanwhile, @freezer71 has created interim npm package freezer-midjourney-api

hi. Can you clarify how to fix it? I have tried installing the package, but the problem still hasn't been resolved.

You should be using

import { Midjourney } from 'freezer-midjourney-api';

instead of

import { Midjourney } from 'midjourney';

For this particular problem to go away.

Remember to check the original package for a permanent fix!

Thank you guys, this saves me.

Jiancong avatar Feb 23 '24 03:02 Jiancong

freezer-midjourney-api

A function has not been fixed...

getCommand(
...
    const url = `${this.config.DiscordBaseUrl}/api/v9/channels/${this.config.ChannelId}/application-commands/search?${searchParams}`;

morganfuchs avatar Feb 23 '24 04:02 morganfuchs

I've opened a pull request with a provisional workaround. Meanwhile, @freezer71 has created interim npm package freezer-midjourney-api

hi. Can you clarify how to fix it? I have tried installing the package, but the problem still hasn't been resolved.

You should be using

import { Midjourney } from 'freezer-midjourney-api';

instead of

import { Midjourney } from 'midjourney';

For this particular problem to go away.

Remember to check the original package for a permanent fix!

Everything seems to be running, but I often encounter the error: ImagineApi failed with status 400. Do you have any experience with this error?

E-toolmaster avatar Feb 23 '24 06:02 E-toolmaster

I've opened a pull request with a provisional workaround. Meanwhile, @freezer71 has created interim npm package freezer-midjourney-api

Thank you @freezer71 ! 🚀

JoSanson avatar Feb 23 '24 09:02 JoSanson

Does Upscale command working for your guys? after applied @freezer71's fix, the imagine one is ok but I am still having issue with Upscale:

Error: CustomApi failed with status 404

jimmy-o avatar Feb 23 '24 12:02 jimmy-o

try this fix. it's working for me - https://github.com/erictik/midjourney-api/pull/256/files

NatalieM11 avatar Feb 23 '24 14:02 NatalieM11

if someone still facing issues with upscale, variations etc can use this package for now https://www.npmjs.com/package/@ymjir/midjourney-api

use

import { Midjourney } from '@ymjir/midjourney-api';

instead of

import { Midjourney } from 'midjourney';

Ymjir avatar Feb 23 '24 20:02 Ymjir

@NatalieM11 could you maybe update https://github.com/erictik/midjourney-ui with this, please? at least on feature branch

the library updates breaks stuff there

or anyone if you fix it in midjourney-ui please 🙏

artemptushkin avatar Feb 24 '24 12:02 artemptushkin

try this fix. it's working for me - https://github.com/erictik/midjourney-api/pull/256/files

@NatalieM11 this pr was merged, and i updated to the latest 4.3.14, but it still dosen't work.

buzuosheng avatar Feb 25 '24 14:02 buzuosheng

Now I get this. v4.3.15 Has anyone had the same thing happen? image

Pepperoniii avatar Feb 25 '24 16:02 Pepperoniii

@jimmy-o thanks for pointing out this issue, i can see that upscale on initial image is working, but when i tried to upscale an individual image, it's causing Error: CustomApi failed with status 404, you can use the client.Custom() function directly and pass the custom_id which you can get from options property of the result object, i can fix the issues later and create a pull request.

const Upscale = await client.Custom({
    customId: CUSTOM_ID,
    msgId: <string>Imagine.id,
    flags: Imagine.flags,
    loading: (uri: string, progress: string) => {
      console.log(progress)
    },
  });

Ymjir avatar Feb 26 '24 08:02 Ymjir

same 😭

misakaikato avatar Feb 27 '24 01:02 misakaikato

Same

KristiyanTs avatar Feb 27 '24 20:02 KristiyanTs

should work with that npm freezer-midjourney-api with new version 4.0.6

freezer71 avatar Feb 28 '24 07:02 freezer71

doesn't work on init got "unxpected end of json input" i have tried with midjourney lib and also with freezer-midjourney-api

6leonardo avatar Feb 28 '24 13:02 6leonardo

can i see the code for the problem

freezer71 avatar Feb 28 '24 17:02 freezer71

@freezer71 image image

Pepperoniii avatar Mar 02 '24 21:03 Pepperoniii

@Pepperoniii you should use 4.0.6 version of freezer-midjourney-api

freezer71 avatar Mar 03 '24 12:03 freezer71