Skip to content

Commit

Permalink
WaitMessage add timestamp options
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric committed Jun 16, 2023
1 parent a15e8c7 commit d198d2f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/midjourney.message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ export class MidjourneyMessage {
UriToHash(uri: string) {
return uri.split("_").pop()?.split(".")[0] ?? "";
}
async WaitMessage(prompt: string, loading?: LoadingHandler) {
var timestamp = Date.now();
async WaitMessage(
prompt: string,
loading?: LoadingHandler,
timestamp?: number
) {
timestamp = timestamp ?? Date.now();
for (let i = 0; i < this.config.MaxWait; i++) {
const msg = await this.FilterMessages(timestamp, prompt, loading);
if (msg !== null) {
Expand Down

0 comments on commit d198d2f

Please sign in to comment.