@azimiao/koishi-plugin-cafe-bot-exp 0.0.28 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +22 -3
- package/package.json +1 -1
- package/lib/cat/config.d.ts +0 -9
- package/lib/cat/index.d.ts +0 -15
- package/lib/common/CafeTimeTools.d.ts +0 -4
- package/lib/common/DailySeededName.d.ts +0 -1
- package/lib/common/PseudoRandom.d.ts +0 -11
- package/lib/common/at.d.ts +0 -1
- package/lib/common/downloadTool.d.ts +0 -3
- package/lib/config.d.ts +0 -11
- package/lib/draw/config.d.ts +0 -24
- package/lib/draw/index.d.ts +0 -15
- package/lib/draw/templete/html.d.ts +0 -2
- package/lib/index.d.ts +0 -17
- package/lib/quiz/config.d.ts +0 -17
- package/lib/quiz/index.d.ts +0 -37
package/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
40
40
|
var import_url = require("url");
|
|
41
41
|
|
|
42
42
|
// package.json
|
|
43
|
-
var version = "0.0.
|
|
43
|
+
var version = "0.0.32";
|
|
44
44
|
|
|
45
45
|
// src/index.ts
|
|
46
46
|
var import_censor = require("@koishijs/censor");
|
|
@@ -524,7 +524,9 @@ var CafeBotQuizConfig = import_koishi3.Schema.object({
|
|
|
524
524
|
qqQuizMDTextID: import_koishi3.Schema.string().description("QQ markdown 纯本文模板ID"),
|
|
525
525
|
qqQuizMDImgID: import_koishi3.Schema.string().description("QQ markdown 题目带图模板ID"),
|
|
526
526
|
qqQuizButtonID: import_koishi3.Schema.string().description("QQ按钮ID"),
|
|
527
|
-
appendMDBtn: import_koishi3.Schema.boolean().description("是否追加QQ按钮").default(false)
|
|
527
|
+
appendMDBtn: import_koishi3.Schema.boolean().description("是否追加QQ按钮").default(false),
|
|
528
|
+
imgWidth: import_koishi3.Schema.number().description("QQ图像宽度").default(0),
|
|
529
|
+
imgHeight: import_koishi3.Schema.number().description("QQ图像高度").default(0)
|
|
528
530
|
}).description("答题配置");
|
|
529
531
|
|
|
530
532
|
// src/common/CafeTimeTools.ts
|
|
@@ -688,14 +690,17 @@ async function apply2(ctx, config) {
|
|
|
688
690
|
}
|
|
689
691
|
await ctx.cache.set("question", argv.session.userId, { question: randomId, answer: answerIndex }, config.answerTimeout * 1e3);
|
|
690
692
|
var msgQQ = {
|
|
693
|
+
content: "111",
|
|
691
694
|
msg_type: 2,
|
|
692
695
|
msg_id: argv.session.messageId,
|
|
696
|
+
timestamp: argv.session.timestamp,
|
|
693
697
|
markdown: {
|
|
694
698
|
custom_template_id: `${qItem.question.img.length > 0 ? config.qqQuizMDImgID : config.qqQuizMDTextID}`,
|
|
695
699
|
params: [
|
|
696
700
|
{
|
|
697
701
|
key: "user",
|
|
698
|
-
values: [
|
|
702
|
+
values: [argv.session && !argv.session.isDirect ? `<qqbot-at-user id="${argv.session.userId}"` : ""]
|
|
703
|
+
// 群聊能@,私聊不能@
|
|
699
704
|
},
|
|
700
705
|
{
|
|
701
706
|
key: "question",
|
|
@@ -724,6 +729,20 @@ async function apply2(ctx, config) {
|
|
|
724
729
|
]
|
|
725
730
|
}
|
|
726
731
|
};
|
|
732
|
+
if (qItem.question.img.length > 0) {
|
|
733
|
+
msgQQ.markdown.params.push({
|
|
734
|
+
key: "img_url",
|
|
735
|
+
values: [qItem.question.img]
|
|
736
|
+
});
|
|
737
|
+
msgQQ.markdown.params.push({
|
|
738
|
+
key: "img_width",
|
|
739
|
+
values: [config.imgWidth]
|
|
740
|
+
});
|
|
741
|
+
msgQQ.markdown.params.push({
|
|
742
|
+
key: "img_height",
|
|
743
|
+
values: [config.imgHeight]
|
|
744
|
+
});
|
|
745
|
+
}
|
|
727
746
|
if (config.appendMDBtn) {
|
|
728
747
|
msgQQ.keyboard = {
|
|
729
748
|
id: config.qqQuizButtonID
|
package/package.json
CHANGED
package/lib/cat/config.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Schema } from "koishi";
|
|
2
|
-
export interface CafeBotCatConfig {
|
|
3
|
-
catName: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const CafeBotCatConfig: Schema<Schemastery.ObjectS<{
|
|
6
|
-
catName: Schema<string, string>;
|
|
7
|
-
}>, Schemastery.ObjectT<{
|
|
8
|
-
catName: Schema<string, string>;
|
|
9
|
-
}>>;
|
package/lib/cat/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 黑猫柯贝
|
|
3
|
-
*/
|
|
4
|
-
import { Context, Schema } from 'koishi';
|
|
5
|
-
import { CafeBotCatConfig } from './config';
|
|
6
|
-
export declare const name = "cafe-bot-exp.cat";
|
|
7
|
-
export interface Config extends CafeBotCatConfig {
|
|
8
|
-
}
|
|
9
|
-
export declare const Config: Schema<Config>;
|
|
10
|
-
export declare const injectDepend: {
|
|
11
|
-
required: any[];
|
|
12
|
-
optional: string[];
|
|
13
|
-
};
|
|
14
|
-
export declare const inject: any[];
|
|
15
|
-
export declare function apply(ctx: Context): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function DailySeededName(uid: any): string;
|
package/lib/common/at.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function At(argv: any, newLine?: boolean): string;
|
package/lib/config.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Schema } from "koishi";
|
|
2
|
-
import { CafeBotDrawConfig } from "./draw/config";
|
|
3
|
-
import { CafeBotQuizConfig } from "./quiz/config";
|
|
4
|
-
import { CafeBotCatConfig } from "./cat/config";
|
|
5
|
-
export interface CafeBotConfig {
|
|
6
|
-
logoUrl: string;
|
|
7
|
-
refreshLogoWhenLoad: boolean;
|
|
8
|
-
useLocalLogoFile: boolean;
|
|
9
|
-
}
|
|
10
|
-
export type Config = CafeBotConfig & CafeBotDrawConfig & CafeBotQuizConfig & CafeBotCatConfig;
|
|
11
|
-
export declare const Config: Schema<Config>;
|
package/lib/draw/config.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 轨迹抽卡配置
|
|
3
|
-
*/
|
|
4
|
-
import { Schema } from "koishi";
|
|
5
|
-
export interface CafeBotDrawConfig {
|
|
6
|
-
baseDataUrl: string;
|
|
7
|
-
forceUpdateDataWhenLoad: boolean;
|
|
8
|
-
ImageServer: string;
|
|
9
|
-
ImageServerAuth: string;
|
|
10
|
-
ImageNoCache: boolean;
|
|
11
|
-
MinCount: number;
|
|
12
|
-
MaxCount: number;
|
|
13
|
-
Star1Name: string;
|
|
14
|
-
Star1Chance: number;
|
|
15
|
-
Star2Name: string;
|
|
16
|
-
Star2Chance: number;
|
|
17
|
-
Star3Name: string;
|
|
18
|
-
Star3Chance: number;
|
|
19
|
-
Star4Name: string;
|
|
20
|
-
Star4Chance: number;
|
|
21
|
-
Star5Name: string;
|
|
22
|
-
Star5Chance: number;
|
|
23
|
-
}
|
|
24
|
-
export declare const CafeBotDrawConfig: Schema<CafeBotDrawConfig>;
|
package/lib/draw/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 轨迹抽卡
|
|
3
|
-
*/
|
|
4
|
-
import { Context, Schema } from 'koishi';
|
|
5
|
-
import { CafeBotDrawConfig } from './config';
|
|
6
|
-
export declare const name = "cafe-bot-exp.draw";
|
|
7
|
-
export declare const injectDepend: {
|
|
8
|
-
required: string[];
|
|
9
|
-
optional: string[];
|
|
10
|
-
};
|
|
11
|
-
export declare const inject: string[];
|
|
12
|
-
export interface Config extends CafeBotDrawConfig {
|
|
13
|
-
}
|
|
14
|
-
export declare const Config: Schema<Config>;
|
|
15
|
-
export declare function apply(ctx: Context, config: Config): Promise<void>;
|
package/lib/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 主入口文件
|
|
3
|
-
*/
|
|
4
|
-
import { Context } from 'koishi';
|
|
5
|
-
import { Config } from './config';
|
|
6
|
-
import '@koishijs/censor';
|
|
7
|
-
import * as draw from "./draw/index";
|
|
8
|
-
import * as quiz from "./quiz/index";
|
|
9
|
-
import * as cat from "./cat/index";
|
|
10
|
-
export declare const name = "cafe-bot-exp";
|
|
11
|
-
export * from "./config";
|
|
12
|
-
export declare const plugins: (typeof draw | typeof quiz | typeof cat)[];
|
|
13
|
-
export declare const inject: {
|
|
14
|
-
required: any[];
|
|
15
|
-
optional: string[];
|
|
16
|
-
};
|
|
17
|
-
export declare function apply(ctx: Context, config: Config): Promise<void>;
|
package/lib/quiz/config.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 轨迹答题配置
|
|
3
|
-
*/
|
|
4
|
-
import { Schema } from "koishi";
|
|
5
|
-
export interface CafeBotQuizConfig {
|
|
6
|
-
baseQuizUrl: string;
|
|
7
|
-
forceUpdateWhenLoad: boolean;
|
|
8
|
-
answerTimeout: number;
|
|
9
|
-
maxQuizPerDay: number;
|
|
10
|
-
redisServer: string;
|
|
11
|
-
redisAuth: string;
|
|
12
|
-
qqQuizMDTextID: string;
|
|
13
|
-
qqQuizMDImgID: string;
|
|
14
|
-
qqQuizButtonID: string;
|
|
15
|
-
appendMDBtn: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare const CafeBotQuizConfig: Schema<CafeBotQuizConfig>;
|
package/lib/quiz/index.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 轨迹问答
|
|
3
|
-
*/
|
|
4
|
-
import { Context, Schema } from 'koishi';
|
|
5
|
-
import { CafeBotQuizConfig } from './config';
|
|
6
|
-
export declare const name = "cafe-bot-exp.quiz";
|
|
7
|
-
export declare const injectDepend: {
|
|
8
|
-
required: string[];
|
|
9
|
-
optional: string[];
|
|
10
|
-
};
|
|
11
|
-
export declare const inject: string[];
|
|
12
|
-
export interface Config extends CafeBotQuizConfig {
|
|
13
|
-
}
|
|
14
|
-
export declare const Config: Schema<Config>;
|
|
15
|
-
interface QuestionCache {
|
|
16
|
-
question: number;
|
|
17
|
-
answer: number;
|
|
18
|
-
}
|
|
19
|
-
declare module '@koishijs/cache' {
|
|
20
|
-
interface Tables {
|
|
21
|
-
question: QuestionCache;
|
|
22
|
-
todayCache: number;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
declare module 'koishi' {
|
|
26
|
-
interface Tables {
|
|
27
|
-
'cafeQuiz': CafeQuiz;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export interface CafeQuiz {
|
|
31
|
-
id: number;
|
|
32
|
-
userId: string;
|
|
33
|
-
right: number;
|
|
34
|
-
wrong: number;
|
|
35
|
-
}
|
|
36
|
-
export declare function apply(ctx: Context, config: Config): Promise<void>;
|
|
37
|
-
export {};
|