-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
23 lines (20 loc) · 880 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { InputParameter } from "@modules/command";
import { Private } from "#genshin/module/private/main";
import { privateClass } from "#genshin/init";
import { getInfo } from "#genshin-h5tool/util/api";
export async function main( { messageData, sendMessage }: InputParameter ): Promise<void> {
if ( new Date().getTime() >= new Date( '2022-04-29 GMT+8' ).getTime() ) {
await sendMessage( '活动已过期,请下次及时参与哦!' )
return;
}
const userID: number = messageData.user_id;
const serID: number = parseInt( messageData.raw_message ) || 1;
const single: Private | string = await privateClass.getSinglePrivate( userID, serID );
if ( typeof single === "string" ) {
await sendMessage( single );
} else {
const { uid, server, cookie } = single.setting;
const ret = await getInfo( userID, uid, server, cookie );
await sendMessage( ret );
}
}