kotori-plugin-penis 1.2.2 → 1.2.4
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/{LICENSE → LICENSE.md} +674 -674
- package/lib/index.d.ts +5 -5
- package/lib/index.js +41 -43
- package/package.json +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Context, Tsu } from 'kotori-bot';
|
|
1
|
+
import { type Context, Tsu } from 'kotori-bot';
|
|
2
2
|
export declare const lang: string[];
|
|
3
3
|
export declare const inject: string[];
|
|
4
4
|
export declare const config: import("kotori-bot").ObjectParser<{
|
|
5
|
-
max: import("kotori-bot").
|
|
6
|
-
min: import("kotori-bot").
|
|
7
|
-
joke: import("kotori-bot").
|
|
8
|
-
avgMinNum: import("kotori-bot").
|
|
5
|
+
max: import("kotori-bot").Parser<number>;
|
|
6
|
+
min: import("kotori-bot").Parser<number>;
|
|
7
|
+
joke: import("kotori-bot").Parser<number>;
|
|
8
|
+
avgMinNum: import("kotori-bot").Parser<number>;
|
|
9
9
|
}>;
|
|
10
10
|
type Config = Tsu.infer<typeof config>;
|
|
11
11
|
export declare function main(ctx: Context, config: Config): void;
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
|
|
2
1
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
* @Package kotori-plugin-penis
|
|
3
|
+
* @Version 1.2.3
|
|
4
|
+
* @Author Himeno <me@hotaru.icu>
|
|
5
|
+
* @Copyright 2024-2025 Hotaru. All rights reserved.
|
|
6
|
+
* @License BAN-ZHINESE-USING
|
|
7
|
+
* @Link https://github.com/kotorijs/kotori
|
|
8
|
+
* @Date 2025/8/4 17:28:33
|
|
9
|
+
*/
|
|
12
10
|
"use strict";
|
|
13
11
|
var __defProp = Object.defineProperty;
|
|
14
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -27,22 +25,22 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
27
25
|
return to;
|
|
28
26
|
};
|
|
29
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
28
|
+
var index_exports = {};
|
|
29
|
+
__export(index_exports, {
|
|
32
30
|
config: () => config,
|
|
33
31
|
inject: () => inject,
|
|
34
32
|
lang: () => lang,
|
|
35
33
|
main: () => main
|
|
36
34
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
36
|
var import_kotori_bot = require("kotori-bot");
|
|
39
37
|
const lang = [__dirname, "../locales"];
|
|
40
38
|
const inject = ["file", "server"];
|
|
41
39
|
const config = import_kotori_bot.Tsu.Object({
|
|
42
|
-
max: import_kotori_bot.Tsu.Number().default(30),
|
|
43
|
-
min: import_kotori_bot.Tsu.Number().default(-30),
|
|
44
|
-
joke: import_kotori_bot.Tsu.Number().default(10),
|
|
45
|
-
avgMinNum: import_kotori_bot.Tsu.Number().default(5)
|
|
40
|
+
max: import_kotori_bot.Tsu.Number().default(30).describe("The maximum length of the dick"),
|
|
41
|
+
min: import_kotori_bot.Tsu.Number().default(-30).describe("The minimum length of the dick"),
|
|
42
|
+
joke: import_kotori_bot.Tsu.Number().default(10).describe("Send a joke when the length is less than value"),
|
|
43
|
+
avgMinNum: import_kotori_bot.Tsu.Number().default(5).describe("The minimum at avg rank")
|
|
46
44
|
});
|
|
47
45
|
function main(ctx, config2) {
|
|
48
46
|
const getNewLength = () => config2.min + Math.floor(Math.random() * (config2.max - config2.min + 1));
|
|
@@ -51,16 +49,11 @@ function main(ctx, config2) {
|
|
|
51
49
|
const saveTodayData = (data) => ctx.file.save(getTodayPath(), data);
|
|
52
50
|
const loadStatData = () => ctx.file.load("stat.json", "json", {});
|
|
53
51
|
const saveStatData = (data) => ctx.file.save("stat.json", data);
|
|
54
|
-
ctx.
|
|
55
|
-
const s = session;
|
|
56
|
-
if (s.message === `${s.api.adapter.config["command-prefix"]}\u4ECA\u65E5\u957F\u5EA6`) s.message = "\u4ECA\u65E5\u957F\u5EA6";
|
|
57
|
-
next();
|
|
58
|
-
});
|
|
59
|
-
ctx.regexp(/^今日长度$/, (_, session) => {
|
|
52
|
+
ctx.command("dick - \u83B7\u53D6\u4ECA\u65E5\u725B\u725B\u957F\u5EA6").shortcut("\u4ECA\u65E5\u957F\u5EA6").action((_, session) => {
|
|
60
53
|
const id = `${session.api.adapter.identity}${session.userId}`;
|
|
61
54
|
const today = loadTodayData();
|
|
62
55
|
const todayLength = typeof today[id] === "number" ? today[id] : getNewLength();
|
|
63
|
-
const params = [
|
|
56
|
+
const params = [import_kotori_bot.Messages.mention(session.userId), todayLength];
|
|
64
57
|
if (todayLength <= 0) session.quick(["newnew.msg.today_length.info.2", params]);
|
|
65
58
|
else if (todayLength > 0 && todayLength <= config2.joke) session.quick(["newnew.msg.today_length.info.1", params]);
|
|
66
59
|
else session.quick(["newnew.msg.today_length.info.0", params]);
|
|
@@ -79,31 +72,36 @@ function main(ctx, config2) {
|
|
|
79
72
|
}
|
|
80
73
|
saveStatData(stat);
|
|
81
74
|
});
|
|
82
|
-
ctx.
|
|
75
|
+
ctx.command("my_dick - \u83B7\u53D6\u6211\u7684\u725B\u725B\u957F\u5EA6").shortcut("\u6211\u7684\u957F\u5EA6").action((_, session) => {
|
|
83
76
|
const stat = loadStatData();
|
|
84
77
|
const person = stat[`${session.api.adapter.identity}${session.userId}`];
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
[
|
|
89
|
-
|
|
78
|
+
const params = [import_kotori_bot.Messages.mention(session.userId)];
|
|
79
|
+
if (!person || person.length <= 0) return session.format("newnew.msg.my_length.fail", params);
|
|
80
|
+
return session.format("newnew.msg.my_length", [
|
|
81
|
+
params[0],
|
|
82
|
+
person[1],
|
|
83
|
+
person[0],
|
|
84
|
+
person[2],
|
|
85
|
+
person[3],
|
|
86
|
+
(person[3] / person[2]).toFixed(2)
|
|
87
|
+
]);
|
|
90
88
|
});
|
|
91
|
-
ctx.
|
|
89
|
+
ctx.command("avg_dick - \u67E5\u770B\u725B\u725B\u957F\u5EA6\u5E73\u5747\u6392\u884C").shortcut("\u5E73\u5747\u6392\u884C").action((_, session) => {
|
|
92
90
|
const stat = loadStatData();
|
|
93
91
|
const statOrigin = loadStatData();
|
|
94
92
|
if (Object.keys(stat).length <= 0) return "newnew.msg.avg_ranking.fail";
|
|
95
|
-
|
|
93
|
+
for (const key in stat) {
|
|
96
94
|
const item = stat[key];
|
|
97
95
|
item[3] /= item[2];
|
|
98
|
-
}
|
|
96
|
+
}
|
|
99
97
|
const entries = Object.entries(stat).filter((val) => val[0].startsWith(session.api.adapter.identity));
|
|
100
98
|
entries.sort((a, b) => b[1][3] - a[1][3]);
|
|
101
99
|
let list = "";
|
|
102
100
|
let num = 1;
|
|
103
|
-
|
|
104
|
-
if (num > 20)
|
|
101
|
+
for (const entry of entries) {
|
|
102
|
+
if (num > 20) continue;
|
|
105
103
|
const nums = entry[1][2];
|
|
106
|
-
if (nums < config2.avgMinNum)
|
|
104
|
+
if (nums < config2.avgMinNum) continue;
|
|
107
105
|
list += session.format("newnew.msg.avg_ranking.list", [
|
|
108
106
|
num,
|
|
109
107
|
entry[0].slice(session.api.adapter.identity.length),
|
|
@@ -112,26 +110,26 @@ function main(ctx, config2) {
|
|
|
112
110
|
statOrigin[entry[0]][3]
|
|
113
111
|
]);
|
|
114
112
|
num += 1;
|
|
115
|
-
}
|
|
116
|
-
return
|
|
113
|
+
}
|
|
114
|
+
return session.format("newnew.msg.avg_ranking", [list]);
|
|
117
115
|
});
|
|
118
|
-
ctx.
|
|
116
|
+
ctx.command("today_dick - \u67E5\u770B\u725B\u725B\u957F\u5EA6\u4ECA\u65E5\u6392\u884C").shortcut("\u4ECA\u65E5\u957F\u5EA6").action((_, session) => {
|
|
119
117
|
const today = loadTodayData();
|
|
120
118
|
if (today.length <= 0) return "newnew.msg.today_ranking.fail";
|
|
121
119
|
const entries = Object.entries(today).filter((val) => val[0].startsWith(session.api.adapter.identity));
|
|
122
120
|
entries.sort((a, b) => b[1] - a[1]);
|
|
123
121
|
let list = "";
|
|
124
122
|
let num = 1;
|
|
125
|
-
|
|
126
|
-
if (num > 20)
|
|
123
|
+
for (const entry of entries) {
|
|
124
|
+
if (num > 20) continue;
|
|
127
125
|
list += session.format("newnew.msg.today_ranking.list", [
|
|
128
126
|
num,
|
|
129
127
|
entry[0].slice(session.api.adapter.identity.length),
|
|
130
128
|
entry[1]
|
|
131
129
|
]);
|
|
132
130
|
num += 1;
|
|
133
|
-
}
|
|
134
|
-
return
|
|
131
|
+
}
|
|
132
|
+
return session.format("newnew.msg.today_ranking", [list]);
|
|
135
133
|
});
|
|
136
134
|
}
|
|
137
135
|
// Annotate the CommonJS export names for ESM import in node:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kotori-plugin-penis",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "查看今日牛牛的长度和排行",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"LICENSE",
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
|
-
"author": "Himeno <
|
|
18
|
+
"author": "Himeno <me@hotaru.icu>",
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"kotori-bot": "^1.
|
|
20
|
+
"kotori-bot": "^1.7.1"
|
|
21
21
|
},
|
|
22
22
|
"kotori": {
|
|
23
23
|
"meta": {
|