forked from erictik/midjourney-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfast.ts
More file actions
33 lines (33 loc) · 697 Bytes
/
fast.ts
File metadata and controls
33 lines (33 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import "dotenv/config";
import { Midjourney } from "../src";
/**
*
* a simple example of using the fast api
* ```
* npx tsx example/fast.ts
* ```
*/
async function main() {
const client = new Midjourney({
ServerId: <string>process.env.SERVER_ID,
ChannelId: <string>process.env.CHANNEL_ID,
SalaiToken: <string>process.env.SALAI_TOKEN,
Debug: true,
Ws: true,
});
await client.Connect();
await client.Fast();
const msg = await client.Info();
console.log({ msg });
client.Close();
}
main()
.then(() => {
console.log("finished");
process.exit(0);
})
.catch((err) => {
console.log("finished");
console.error(err);
process.exit(1);
});