Skip to content

Commit

Permalink
Merge pull request #20 from erictik:progress
Browse files Browse the repository at this point in the history
add progress
  • Loading branch information
zcpua authored May 9, 2023
2 parents d6f5850 + e7a0e64 commit 876e689
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/midjourney.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LoadingHandler } from "./interfaces";
import { MidjourneyMessage } from "./midjourney.message";
import { CreateQueue } from "./queue";
import { random, sleep } from "./utls";
Expand All @@ -12,7 +13,7 @@ export class Midjourney extends MidjourneyMessage {
super(ChannelId, SalaiToken, debug);
}

async Imagine(prompt: string, loading?: (uri: string) => void) {
async Imagine(prompt: string, loading?: LoadingHandler) {
if (!prompt.includes("--seed")) {
const speed = random(1000, 9999);
prompt = `${prompt} --seed ${speed}`;
Expand Down Expand Up @@ -113,7 +114,7 @@ export class Midjourney extends MidjourneyMessage {
index: number,
msgId: string,
msgHash: string,
loading?: (uri: string) => void
loading?: LoadingHandler
) {
// index is 1-4
if (index < 1 || index > 4) {
Expand Down Expand Up @@ -148,7 +149,7 @@ export class Midjourney extends MidjourneyMessage {
index: number,
msgId: string,
msgHash: string,
loading?: (uri: string) => void
loading?: LoadingHandler
) {
// index is 1-4
if (index < 1 || index > 4) {
Expand Down

0 comments on commit 876e689

Please sign in to comment.