-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinit.ts
More file actions
58 lines (54 loc) · 1.53 KB
/
init.ts
File metadata and controls
58 lines (54 loc) · 1.53 KB
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
import {OrderConfig} from "@/modules/command";
import {AuthLevel} from "@/modules/management/auth";
import {MessageScope} from "@/modules/message";
import {Cookies} from "./module/cookies";
import {SignConfig} from "./module/config";
import {SignClass} from "./module/sign";
import bot from "ROOT";
import {createServer} from "./server";
import {definePlugin} from "@/modules/plugin";
import SignRouter from "#/genshin_sign/routes/sign-route";
export const cookies = new Cookies();
export const signConfig = new SignConfig(bot.file);
export const signClass = new SignClass(signConfig, cookies);
const sign: OrderConfig = {
type: "order",
cmdKey: "genshin.mys.sign",
desc: [ "米游社签到", ""],
headers: [ "mysSign"],
regexps: [ "" ],
main: "achieves/sign",
auth: AuthLevel.Manager,
detail: "使用配置中cookie的米游社签到",
scope: MessageScope.Private
}
const privateSign: OrderConfig = {
type: "order",
cmdKey: "genshin.mys.private-sign",
desc: [ "私人服务列表米游社签到", "(账户编号)" ],
headers: [ "sub_mys_sign" ],
regexps: [ "(\\d+)?" ],
main: "achieves/private/sign"
};
// test-plugin/init.ts
export default definePlugin( {
name: "genshin_sign",
cfgList: [ sign, privateSign, ],
repo: {
owner: "wickedll",
repoName: "genshin_sign", // 仓库名称
ref: "main" // 分支名称
},
server: {
routers:{
"/api/sign" : SignRouter
}
},
mounted() {
console.log( "[genshin_sign] 插件初始化")
// 插件行为
if(!signConfig.openTiming){
createServer(signConfig, bot.logger);
}
}
} );