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

client.init() doesn't execute

Open bingyuyap opened this issue 1 year ago • 3 comments

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

    ServerId: <string>process.env.SERVER_ID,
    ChannelId: <string>process.env.CHANNEL_ID,
    SalaiToken: <string>process.env.SALAI_TOKEN,
    HuggingFaceToken: <string>process.env.HUGGINGFACE_TOKEN,
    Debug: true,
    Ws: true,
  });
  await client.Connect();
  const Imagine = await client.Imagine(
    "Red hamster smoking a cigaret, https://media.discordapp.net/attachments/1108515696385720410/1118385339732590682/DanielH_A_giant_hamster_monster._Friendly_in_a_business_suit_si_d4be1836-a4e1-41a8-b1d7-99eebc521220.png?width=1878&height=1878 ",
    (uri: string, progress: string) => {
      console.log("Imagine.loading", uri, "progress", progress);
    }
  );``` 

this part of code gets stuck at `await client.Connect()` and doesn't execute anything at all. It was fine earlier today but somehow stopped working

### Describe the bug

**Describe the bug**
![image](https://github.com/erictik/midjourney-client/assets/62840970/c4b8133d-95c3-4511-94a4-ef9f34ae8f6b)

**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

no errors, when debu is true just stuck at open.time 0 2023-06-20T07:12:15.737Z

bingyuyap avatar Jun 20 '23 07:06 bingyuyap

check SALAI_TOKEN

zcpua avatar Jun 20 '23 09:06 zcpua

https://github.com/erictik/midjourney-client/blob/main/example/imagine.ts

zcpua avatar Jun 20 '23 09:06 zcpua

@zcpua SALAI_TOKEN was correct all along, I wonder if there was a rate limit from connecting too many clients without closing the client. I had to refresh my salai tokens to work

bingyuyap avatar Jun 20 '23 13:06 bingyuyap