koishi-plugin-ciyi 1.0.1 → 1.0.3

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 CHANGED
@@ -175,7 +175,7 @@ ${formattedRanks}`;
175
175
  return await sendMsg(session, "请输入两字词语!");
176
176
  }
177
177
  if (!allWords_default.includes(guess)) {
178
- return await sendMsg(session, "${guess} 不在词库中");
178
+ return await sendMsg(session, `${guess} 不在词库中`);
179
179
  }
180
180
  let gameInfo = (await ctx.database.get("ciyi", {
181
181
  channelId: session.channelId
@@ -316,7 +316,7 @@ ${formattedRanks}`;
316
316
  }
317
317
  );
318
318
  }
319
- const msg = `每日词意挑战开始!
319
+ const msg = `词意每日挑战开始!
320
320
 
321
321
  目标
322
322
  猜出系统选择的两字词语
@@ -337,11 +337,10 @@ ${formattedRanks}`;
337
337
  async function fetchCiYi(word) {
338
338
  const url = `https://ci-ying.oss-cn-zhangjiakou.aliyuncs.com/v1/ci-yi-list/${word}.txt`;
339
339
  try {
340
- const response = await fetch(url);
341
- if (!response.ok) {
342
- return null;
343
- }
344
- return await response.text();
340
+ const response = await ctx.http.get(url, {
341
+ responseType: "text"
342
+ });
343
+ return response;
345
344
  } catch (error) {
346
345
  logger.error("Error fetching data:", error);
347
346
  return null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-ciyi",
3
3
  "description": "Koishi 的词意(猜词游戏)插件。根据词语的含义相似程度,猜测正确的词语。",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
package/readme.md CHANGED
@@ -21,6 +21,8 @@ Koishi 的词意(猜词游戏)插件。根据词语的含义相似程度,
21
21
 
22
22
  ---
23
23
 
24
+ ### License
25
+
24
26
  _Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option._
25
27
 
26
28
  _Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions._