Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric committed May 15, 2023
1 parent f0374bd commit 4090446
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ yarn add midjourney

```typescript
import { Midjourney } from "midjourney";
const client = new Midjourney(
process.env.SERVER_ID,
process.env.CHANNEL_ID,
process.env.SALAI_TOKEN
);
const client = new Midjourney({
ServerId: <string>process.env.SERVER_ID,
ChannelId: <string>process.env.CHANNEL_ID,
SalaiToken: <string>process.env.SALAI_TOKEN,
Debug: true,
});
const msg = await client.Imagine("A little pink elephant", (uri: string) => {
console.log("loading", uri);
});
Expand Down
15 changes: 8 additions & 7 deletions example/imagine.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ const { Midjourney } = require("../libs");
*
* a simple example of how to use the imagine command
* ```
* npx tsx example/imagine.ts
* node example/imagine.js
* ```
*/
async function main() {
const client = new Midjourney(
process.env.SERVER_ID,
process.env.CHANNEL_ID,
process.env.SALAI_TOKEN,
true
);
const client = new Midjourney({
ServerId: process.env.SERVER_ID,
ChannelId: process.env.CHANNEL_ID,
SalaiToken: process.env.SALAI_TOKEN,
Debug: true,
SessionId: process.env.SALAI_TOKEN || "8bb7f5b79c7a49f7d0824ab4b8773a81",
} );
const msg = await client.Imagine("A little pink elephant", (uri) => {
console.log("loading", uri);
});
Expand Down

0 comments on commit 4090446

Please sign in to comment.