-
-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric
committed
May 14, 2023
1 parent
f76574a
commit dad12fc
Showing
12 changed files
with
133 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import "dotenv/config"; | ||
import { Midjourney, MidjourneyMessage } from "../src"; | ||
/** | ||
* | ||
* a simple example of how to use the imagine command | ||
* ``` | ||
* npx tsx example/message.ts | ||
* ``` | ||
*/ | ||
async function main() { | ||
const client = new MidjourneyMessage({ | ||
ChannelId: <string>process.env.CHANNEL_ID, | ||
SalaiToken: <string>process.env.SALAI_TOKEN, | ||
}); | ||
const msg = await client.RetrieveMessages(); | ||
console.log({ msg }); | ||
} | ||
main().catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from "./message"; | ||
export * from "./message.config"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export interface MessageConfig { | ||
ChannelId: string; | ||
SalaiToken: string; | ||
Debug: boolean; | ||
Limit: number; | ||
MaxWait: number; | ||
} | ||
export interface MessageConfigParam { | ||
ChannelId: string; | ||
SalaiToken: string; | ||
Debug?: boolean; | ||
Limit?: number; | ||
MaxWait?: number; | ||
} | ||
export interface MidjourneyConfig extends MessageConfig { | ||
ServerId: string; | ||
SessionId: string; | ||
} | ||
|
||
export interface MidjourneyConfigParam extends MessageConfigParam { | ||
ServerId: string; | ||
SessionId?: string; | ||
} | ||
export const DefaultMessageConfig: MessageConfig = { | ||
ChannelId: "", | ||
SalaiToken: "", | ||
Debug: false, | ||
Limit: 50, | ||
MaxWait: 100, | ||
}; | ||
export const DefaultMidjourneyConfig: MidjourneyConfig = { | ||
...DefaultMessageConfig, | ||
ServerId: "", | ||
SessionId: "8bb7f5b79c7a49f7d0824ab4b8773a81", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters