-
-
Notifications
You must be signed in to change notification settings - Fork 271
/
config.ts
61 lines (59 loc) · 1.76 KB
/
config.ts
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import WebSocket from "isomorphic-ws";
export type FetchFn = typeof fetch;
export type WebSocketCl = typeof WebSocket;
export const MJBot = "936929561302675456";
export const NijiBot = "1022952195194359889";
export interface MJConfig {
ChannelId: string;
SalaiToken: string;
BotId: typeof MJBot | typeof NijiBot;
Debug: boolean;
Limit: number;
MaxWait: number;
SessionId: string;
ServerId?: string;
Ws?: boolean;
Remix?: boolean;
HuggingFaceToken?: string;
DiscordBaseUrl: string;
WsBaseUrl: string;
fetch: FetchFn;
ApiInterval: number;
WebSocket: WebSocketCl;
ImageProxy: string;
}
export interface MJConfigParam {
SalaiToken: string; //DISCORD_TOKEN
ChannelId?: string; //DISCORD_CHANNEL_ID
ServerId?: string; //DISCORD_SERVER_ID
BotId?: typeof MJBot | typeof NijiBot; //DISCORD_BOT_ID MJBot OR NijiBot
Debug?: boolean; // print log
ApiInterval?: number; //ApiInterval request api interval
Limit?: number; //Limit of get message list
MaxWait?: number;
Remix?: boolean; //Remix:true use remix mode
Ws?: boolean; //Ws:true use websocket get discord message (ephemeral message)
HuggingFaceToken?: string; //HuggingFaceToken for verify human
SessionId?: string;
DiscordBaseUrl?: string;
ImageProxy?: string;
WsBaseUrl?: string;
fetch?: FetchFn; //Node.js<18 need node.fetch Or proxy
WebSocket?: WebSocketCl; //isomorphic-ws Or proxy
}
export const DefaultMJConfig: MJConfig = {
BotId: MJBot,
ChannelId: "1077800642086703114",
SalaiToken: "",
ApiInterval: 350,
SessionId: "8bb7f5b79c7a49f7d0824ab4b8773a81",
Debug: false,
Limit: 50,
Ws: true,
MaxWait: 200,
ImageProxy: "",
DiscordBaseUrl: "https://discord.com",
WsBaseUrl: "wss://gateway.discord.gg/?encoding=json&v=9",
fetch: fetch,
WebSocket: WebSocket,
};