koishi-plugin-starfx-bot 0.19.10 → 0.19.12
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.d.ts +1 -0
- package/lib/index.js +18 -9
- package/package.json +1 -1
- package/readme.md +2 -0
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -63,7 +63,7 @@ var package_default = {
|
|
|
63
63
|
contributors: [
|
|
64
64
|
"StarFreedomX <starfreedomx@outlook.com>"
|
|
65
65
|
],
|
|
66
|
-
version: "0.19.
|
|
66
|
+
version: "0.19.12",
|
|
67
67
|
main: "lib/index.js",
|
|
68
68
|
typings: "lib/index.d.ts",
|
|
69
69
|
files: [
|
|
@@ -1144,15 +1144,16 @@ async function sendImages(session, cfg, imageUrls) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
__name(sendImages, "sendImages");
|
|
1146
1146
|
async function getXImageBase64(url, cfg) {
|
|
1147
|
-
const
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1147
|
+
const opts = {
|
|
1148
|
+
responseType: "arraybuffer"
|
|
1149
|
+
};
|
|
1150
|
+
if (cfg.proxyUrl) {
|
|
1151
|
+
opts.httpAgent = new import_http_proxy_agent.HttpProxyAgent(cfg.proxyUrl);
|
|
1152
|
+
opts.httpsAgent = new import_https_proxy_agent.HttpsProxyAgent(cfg.proxyUrl);
|
|
1153
|
+
}
|
|
1154
|
+
const res = await import_axios.default.get(url, opts);
|
|
1152
1155
|
const base64 = Buffer.from(res.data, "binary").toString("base64");
|
|
1153
|
-
|
|
1154
|
-
console.log("success");
|
|
1155
|
-
return dataUrl;
|
|
1156
|
+
return `data:image/png;base64,${base64}`;
|
|
1156
1157
|
}
|
|
1157
1158
|
__name(getXImageBase64, "getXImageBase64");
|
|
1158
1159
|
|
|
@@ -1222,6 +1223,9 @@ var Config = import_koishi5.Schema.intersect([
|
|
|
1222
1223
|
minRepeatTimes: import_koishi5.Schema.number().default(2).description("最少重复次数"),
|
|
1223
1224
|
repeatPossibility: import_koishi5.Schema.number().role("slider").min(0).max(1).step(0.01).default(0.3).description("复读发生概率")
|
|
1224
1225
|
}).description("复读功能"),
|
|
1226
|
+
import_koishi5.Schema.object({
|
|
1227
|
+
myId: import_koishi5.Schema.boolean().default(false).description("查询gid uid cid")
|
|
1228
|
+
}).description("我的信息查询"),
|
|
1225
1229
|
import_koishi5.Schema.object({
|
|
1226
1230
|
filePathToBase64: import_koishi5.Schema.boolean().default(false).description(
|
|
1227
1231
|
"在消息发送前检查是否有file://,如果有那么转换为base64再发送"
|
|
@@ -1460,6 +1464,11 @@ function apply(ctx, cfg) {
|
|
|
1460
1464
|
}
|
|
1461
1465
|
});
|
|
1462
1466
|
}
|
|
1467
|
+
if (cfg.myId) {
|
|
1468
|
+
ctx.command("my-gid").action(({ session }) => session.gid);
|
|
1469
|
+
ctx.command("my-uid").action(({ session }) => session.uid);
|
|
1470
|
+
ctx.command("my-cid").action(({ session }) => session.cid);
|
|
1471
|
+
}
|
|
1463
1472
|
if (cfg.searchExchangeRate) {
|
|
1464
1473
|
ctx.command("查汇率 <exchangeParam:text>").usage("查询当前汇率").example("查汇率 JPY : 查询日元兑换人民币的汇率(3位字母)").example("查汇率 JPYCNY : 查询日元兑换人民币的汇率(6位字母)").example("查汇率 -r avdzk2 : 查询日元兑换人民币的汇率(msn代码avdzk2)").example(
|
|
1465
1474
|
"查汇率 -r auvwoc : 查询黄金的价格(msn代码auvwoc, 很怪吧我也不知道为什么是这个)"
|
package/package.json
CHANGED