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 CHANGED
@@ -44,6 +44,7 @@ export interface Config {
44
44
  iLoveYou: boolean;
45
45
  replyBot: string;
46
46
  sendLocalImage: sendLocalImageConfigDict;
47
+ myId: boolean;
47
48
  openRepeat: boolean;
48
49
  minRepeatTimes: number;
49
50
  repeatPossibility: number;
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.10",
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 httpAgent = new import_http_proxy_agent.HttpProxyAgent(cfg.proxyUrl);
1148
- const httpsAgent = new import_https_proxy_agent.HttpsProxyAgent(cfg.proxyUrl);
1149
- import_axios.default.defaults.httpAgent = httpAgent;
1150
- import_axios.default.defaults.httpsAgent = httpsAgent;
1151
- const res = await import_axios.default.get(url, { responseType: "arraybuffer" });
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
- const dataUrl = `data:image/png;base64,${base64}`;
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
@@ -4,7 +4,7 @@
4
4
  "contributors": [
5
5
  "StarFreedomX <starfreedomx@outlook.com>"
6
6
  ],
7
- "version": "0.19.10",
7
+ "version": "0.19.12",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
10
10
  "files": [
package/readme.md CHANGED
@@ -122,3 +122,5 @@ StarFreedomX机器人的小功能,自用
122
122
  | `0.19.8` | base64适配linux目录 |
123
123
  | `0.19.9` | base64更改适配windows |
124
124
  | `0.19.10` | 减少不必要的控制台输出 |
125
+ | `0.19.11` | 修复无代理情况下无法查看原图的bug |
126
+ | `0.20.0` | gid uid cid查询功能 |