erictik / midjourney-api

MidJourney client. Unofficial Node.js client
Apache License 2.0
1.69k stars 283 forks source link

Initializing a client fails #200

Open alchaplinsky opened 1 year ago

alchaplinsky commented 1 year ago

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

const DISCORD_SERVER_ID = 1133306614422708234;
const DISCORD_CHANNEL_ID = 1133306615282548788;
const DISCORD_TOKEN =  "<TOKEN>";

let { Midjourney } = require("midjourney");

let client = new Midjourney({
  ServerId: DISCORD_SERVER_ID,
  ChannelId: DISCORD_CHANNEL_ID,
  SalaiToken: DISCORD_TOKEN,
  Debug: true,
});

await client.init();

Describe the bug

Describe the bug Following the README in this repo. Created a server and invited Midjourney bot to it. Assigned DISCORD_SERVER_ID, DISCORD_CHANNEL_ID, DISCORD_TOKEN variables and tried to call await client.init().

Expected behavior Client initialization should be successful.

error log

Uncaught Error: Failed to get application_commands for command settings
    at MidjourneyApi.getCommand (/Users/alex/Projects/assistant/node_modules/midjourney/libs/command.js:82:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Midjourney.Connect (/Users/alex/Projects/assistant/node_modules/midjourney/libs/midjourney.js:32:13)
    at async Midjourney.init (/Users/alex/Projects/assistant/node_modules/midjourney/libs/midjourney.js:44:9)
    at async REPL12:1:33
bingyuyap commented 1 year ago

got the same error here when using imagine api - api is very unusable now. Hopefully we can escalate this issue thanks!

6leonardo commented 1 year ago

got the same error

Sikandarkhan commented 1 year ago

Experiencing the same error.

bingyuyap commented 1 year ago

found the reason - likely salai token is invalid. Try using a new salai token

manhhailua commented 1 year ago

Becareful guys, ServerId and ChannelId should be passed as string or they will be automatically rounded down by JS.

WhaSukGO commented 1 year ago

@bingyuyap Good call!

fberbert commented 7 months ago

I encountered the same error. Despite logging out and back into Discord, and updating the Discord token, the issue persists without any success.

Soundpulse commented 7 months ago

same error here

NatalieM11 commented 7 months ago

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