@zhin.js/plugin-60s 1.1.8 → 1.1.10

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.
Files changed (165) hide show
  1. package/README.md +6 -0
  2. package/commands/60s/index.js +2 -2
  3. package/commands/60s/index.ts +2 -2
  4. package/commands/bing/index.js +2 -2
  5. package/commands/bing/index.ts +2 -2
  6. package/commands/douyin/[[limit]]/index.js +2 -2
  7. package/commands/douyin/[[limit]]/index.ts +2 -2
  8. package/commands/duanzi/index.js +2 -2
  9. package/commands/duanzi/index.ts +2 -2
  10. package/commands/exchange/index.js +3 -3
  11. package/commands/exchange/index.ts +3 -3
  12. package/commands/fanyi/[text]/index.js +2 -2
  13. package/commands/fanyi/[text]/index.ts +2 -2
  14. package/commands/fuel/[province]/index.js +2 -2
  15. package/commands/fuel/[province]/index.ts +2 -2
  16. package/commands/gold/index.js +2 -2
  17. package/commands/gold/index.ts +2 -2
  18. package/commands/history/index.js +2 -2
  19. package/commands/history/index.ts +2 -2
  20. package/commands/hitokoto/[type]/index.js +2 -2
  21. package/commands/hitokoto/[type]/index.ts +2 -2
  22. package/commands/ip/[ip]/index.js +2 -2
  23. package/commands/ip/[ip]/index.ts +2 -2
  24. package/commands/kfc/index.js +2 -2
  25. package/commands/kfc/index.ts +2 -2
  26. package/commands/moyu/index.js +2 -2
  27. package/commands/moyu/index.ts +2 -2
  28. package/commands/toutiao/[[limit]]/index.js +2 -2
  29. package/commands/toutiao/[[limit]]/index.ts +2 -2
  30. package/commands/weather/[city]/index.js +2 -2
  31. package/commands/weather/[city]/index.ts +2 -2
  32. package/commands/weibo/[[limit]]/index.js +2 -2
  33. package/commands/weibo/[[limit]]/index.ts +2 -2
  34. package/commands/zhihu/[[limit]]/index.js +2 -2
  35. package/commands/zhihu/[[limit]]/index.ts +2 -2
  36. package/lib/client.d.ts +2 -1
  37. package/lib/client.d.ts.map +1 -1
  38. package/lib/client.js +6 -5
  39. package/lib/client.js.map +1 -1
  40. package/lib/handlers/60s-news.d.ts +2 -1
  41. package/lib/handlers/60s-news.d.ts.map +1 -1
  42. package/lib/handlers/60s-news.js +4 -3
  43. package/lib/handlers/60s-news.js.map +1 -1
  44. package/lib/handlers/bing-image.d.ts +2 -1
  45. package/lib/handlers/bing-image.d.ts.map +1 -1
  46. package/lib/handlers/bing-image.js +4 -3
  47. package/lib/handlers/bing-image.js.map +1 -1
  48. package/lib/handlers/douyin-hot.d.ts +2 -1
  49. package/lib/handlers/douyin-hot.d.ts.map +1 -1
  50. package/lib/handlers/douyin-hot.js +4 -3
  51. package/lib/handlers/douyin-hot.js.map +1 -1
  52. package/lib/handlers/duanzi.d.ts +2 -1
  53. package/lib/handlers/duanzi.d.ts.map +1 -1
  54. package/lib/handlers/duanzi.js +4 -3
  55. package/lib/handlers/duanzi.js.map +1 -1
  56. package/lib/handlers/exchange-rate.d.ts +2 -1
  57. package/lib/handlers/exchange-rate.d.ts.map +1 -1
  58. package/lib/handlers/exchange-rate.js +6 -5
  59. package/lib/handlers/exchange-rate.js.map +1 -1
  60. package/lib/handlers/fuel-price.d.ts +2 -1
  61. package/lib/handlers/fuel-price.d.ts.map +1 -1
  62. package/lib/handlers/fuel-price.js +5 -4
  63. package/lib/handlers/fuel-price.js.map +1 -1
  64. package/lib/handlers/gold-price.d.ts +2 -1
  65. package/lib/handlers/gold-price.d.ts.map +1 -1
  66. package/lib/handlers/gold-price.js +7 -6
  67. package/lib/handlers/gold-price.js.map +1 -1
  68. package/lib/handlers/history-today.d.ts +2 -1
  69. package/lib/handlers/history-today.d.ts.map +1 -1
  70. package/lib/handlers/history-today.js +5 -4
  71. package/lib/handlers/history-today.js.map +1 -1
  72. package/lib/handlers/hitokoto.d.ts +2 -1
  73. package/lib/handlers/hitokoto.d.ts.map +1 -1
  74. package/lib/handlers/hitokoto.js +4 -3
  75. package/lib/handlers/hitokoto.js.map +1 -1
  76. package/lib/handlers/ip-query.d.ts +2 -1
  77. package/lib/handlers/ip-query.d.ts.map +1 -1
  78. package/lib/handlers/ip-query.js +7 -6
  79. package/lib/handlers/ip-query.js.map +1 -1
  80. package/lib/handlers/kfc.d.ts +2 -1
  81. package/lib/handlers/kfc.d.ts.map +1 -1
  82. package/lib/handlers/kfc.js +4 -3
  83. package/lib/handlers/kfc.js.map +1 -1
  84. package/lib/handlers/moyu.d.ts +2 -1
  85. package/lib/handlers/moyu.d.ts.map +1 -1
  86. package/lib/handlers/moyu.js +8 -7
  87. package/lib/handlers/moyu.js.map +1 -1
  88. package/lib/handlers/toutiao-hot.d.ts +2 -1
  89. package/lib/handlers/toutiao-hot.d.ts.map +1 -1
  90. package/lib/handlers/toutiao-hot.js +4 -3
  91. package/lib/handlers/toutiao-hot.js.map +1 -1
  92. package/lib/handlers/translate.d.ts +2 -1
  93. package/lib/handlers/translate.d.ts.map +1 -1
  94. package/lib/handlers/translate.js +7 -6
  95. package/lib/handlers/translate.js.map +1 -1
  96. package/lib/handlers/weather.d.ts +2 -1
  97. package/lib/handlers/weather.d.ts.map +1 -1
  98. package/lib/handlers/weather.js +9 -8
  99. package/lib/handlers/weather.js.map +1 -1
  100. package/lib/handlers/weibo-hot.d.ts +2 -1
  101. package/lib/handlers/weibo-hot.d.ts.map +1 -1
  102. package/lib/handlers/weibo-hot.js +4 -3
  103. package/lib/handlers/weibo-hot.js.map +1 -1
  104. package/lib/handlers/zhihu-hot.d.ts +2 -1
  105. package/lib/handlers/zhihu-hot.d.ts.map +1 -1
  106. package/lib/handlers/zhihu-hot.js +4 -3
  107. package/lib/handlers/zhihu-hot.js.map +1 -1
  108. package/lib/i18n.d.ts +2 -0
  109. package/lib/i18n.d.ts.map +1 -0
  110. package/lib/i18n.js +180 -0
  111. package/lib/i18n.js.map +1 -0
  112. package/package.json +6 -6
  113. package/skills/60s-life/tools/duanzi/index.js +1 -1
  114. package/skills/60s-life/tools/duanzi/index.ts +1 -1
  115. package/skills/60s-life/tools/history_today/index.js +1 -1
  116. package/skills/60s-life/tools/history_today/index.ts +1 -1
  117. package/skills/60s-life/tools/hitokoto/index.js +1 -1
  118. package/skills/60s-life/tools/hitokoto/index.ts +1 -1
  119. package/skills/60s-life/tools/kfc/index.js +1 -1
  120. package/skills/60s-life/tools/kfc/index.ts +1 -1
  121. package/skills/60s-life/tools/moyu/index.js +1 -1
  122. package/skills/60s-life/tools/moyu/index.ts +1 -1
  123. package/skills/60s-life/tools/weather/index.js +1 -1
  124. package/skills/60s-life/tools/weather/index.ts +1 -1
  125. package/skills/60s-market/tools/exchange_rate/index.js +1 -1
  126. package/skills/60s-market/tools/exchange_rate/index.ts +1 -1
  127. package/skills/60s-market/tools/fuel_price/index.js +1 -1
  128. package/skills/60s-market/tools/fuel_price/index.ts +1 -1
  129. package/skills/60s-market/tools/gold_price/index.js +1 -1
  130. package/skills/60s-market/tools/gold_price/index.ts +1 -1
  131. package/skills/60s-media/tools/bing_image/index.js +1 -1
  132. package/skills/60s-media/tools/bing_image/index.ts +1 -1
  133. package/skills/60s-news/tools/60s_news/index.js +1 -1
  134. package/skills/60s-news/tools/60s_news/index.ts +1 -1
  135. package/skills/60s-news/tools/douyin_hot/index.js +1 -1
  136. package/skills/60s-news/tools/douyin_hot/index.ts +1 -1
  137. package/skills/60s-news/tools/toutiao_hot/index.js +1 -1
  138. package/skills/60s-news/tools/toutiao_hot/index.ts +1 -1
  139. package/skills/60s-news/tools/weibo_hot/index.js +1 -1
  140. package/skills/60s-news/tools/weibo_hot/index.ts +1 -1
  141. package/skills/60s-news/tools/zhihu_hot/index.js +1 -1
  142. package/skills/60s-news/tools/zhihu_hot/index.ts +1 -1
  143. package/skills/60s-utility/tools/ip_query/index.js +1 -1
  144. package/skills/60s-utility/tools/ip_query/index.ts +1 -1
  145. package/skills/60s-utility/tools/translate_60s/index.js +1 -1
  146. package/skills/60s-utility/tools/translate_60s/index.ts +1 -1
  147. package/src/client.ts +7 -4
  148. package/src/handlers/60s-news.ts +5 -3
  149. package/src/handlers/bing-image.ts +5 -3
  150. package/src/handlers/douyin-hot.ts +5 -3
  151. package/src/handlers/duanzi.ts +5 -3
  152. package/src/handlers/exchange-rate.ts +7 -4
  153. package/src/handlers/fuel-price.ts +6 -4
  154. package/src/handlers/gold-price.ts +8 -6
  155. package/src/handlers/history-today.ts +6 -4
  156. package/src/handlers/hitokoto.ts +5 -3
  157. package/src/handlers/ip-query.ts +8 -6
  158. package/src/handlers/kfc.ts +5 -3
  159. package/src/handlers/moyu.ts +9 -7
  160. package/src/handlers/toutiao-hot.ts +5 -3
  161. package/src/handlers/translate.ts +8 -6
  162. package/src/handlers/weather.ts +10 -8
  163. package/src/handlers/weibo-hot.ts +5 -3
  164. package/src/handlers/zhihu-hot.ts +5 -3
  165. package/src/i18n.ts +180 -0
package/README.md CHANGED
@@ -61,3 +61,9 @@ plugins:
61
61
  ## License
62
62
 
63
63
  MIT
64
+
65
+ ## Language / 语言
66
+
67
+ 命令说明和执行反馈跟随当前操作语言(简体中文或英文);用户输入与第三方内容保持原样,不进行自动翻译。语言与时区、权限和实际执行行为独立。参见[官方插件语言说明](../../README.md#语言与内容)。
68
+
69
+ Command feedback follows the operation language. User input and third-party content remain unchanged. See the [localization guide](../../../docs/en/configuration/localization.md).
@@ -3,6 +3,6 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/60s-news.js";
5
5
  export default defineCommand({
6
- description: '每日60秒新闻',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '每日60秒新闻', descriptionI18n: { en: "Daily 60-second news" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/60s-news.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '每日60秒新闻',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '每日60秒新闻', descriptionI18n: { en: "Daily 60-second news" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/bing-image.js";
5
5
  export default defineCommand({
6
- description: 'Bing 每日壁纸',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: 'Bing 每日壁纸', descriptionI18n: { en: "Bing daily wallpaper" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/bing-image.js';
4
4
 
5
5
  export default defineCommand({
6
- description: 'Bing 每日壁纸',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: 'Bing 每日壁纸', descriptionI18n: { en: "Bing daily wallpaper" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/douyin-hot.js";
5
5
  export default defineCommand({
6
- description: '抖音热搜',
6
+ description: '抖音热搜', descriptionI18n: { en: "Douyin trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/douyin-hot.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '抖音热搜',
6
+ description: '抖音热搜', descriptionI18n: { en: "Douyin trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
@@ -3,6 +3,6 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/duanzi.js";
5
5
  export default defineCommand({
6
- description: '随机段子',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '随机段子', descriptionI18n: { en: "Random joke" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/duanzi.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '随机段子',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '随机段子', descriptionI18n: { en: "Random joke" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,9 +3,9 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/exchange-rate.js";
5
5
  export default defineCommand({
6
- description: '货币汇率',
7
- execute: ({ args, use }) => handler(use(sixtySClientToken), {
6
+ description: '货币汇率', descriptionI18n: { en: "Currency exchange rates" },
7
+ execute: ({ args, use, locale }) => handler(use(sixtySClientToken), {
8
8
  from: args[0] != null ? String(args[0]) : undefined,
9
9
  to: args[1] != null ? String(args[1]) : undefined,
10
- }),
10
+ }, locale),
11
11
  });
@@ -3,9 +3,9 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/exchange-rate.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '货币汇率',
7
- execute: ({ args, use }) => handler(use(sixtySClientToken), {
6
+ description: '货币汇率', descriptionI18n: { en: "Currency exchange rates" },
7
+ execute: ({ args, use, locale }) => handler(use(sixtySClientToken), {
8
8
  from: args[0] != null ? String(args[0]) : undefined,
9
9
  to: args[1] != null ? String(args[1]) : undefined,
10
- }),
10
+ }, locale),
11
11
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/translate.js";
5
5
  export default defineCommand({
6
- description: '文本翻译',
6
+ description: '文本翻译', descriptionI18n: { en: "Translate text" },
7
7
  params: { text: { type: 'string' } },
8
- execute: ({ params, args, use }) => handler(use(sixtySClientToken), { text: String(params.text), to: args[0] != null ? String(args[0]) : undefined }),
8
+ execute: ({ params, args, use, locale }) => handler(use(sixtySClientToken), { text: String(params.text), to: args[0] != null ? String(args[0]) : undefined }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/translate.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '文本翻译',
6
+ description: '文本翻译', descriptionI18n: { en: "Translate text" },
7
7
  params: { text: { type: 'string' } },
8
- execute: ({ params, args, use }) => handler(use(sixtySClientToken), { text: String(params.text), to: args[0] != null ? String(args[0]) : undefined }),
8
+ execute: ({ params, args, use, locale }) => handler(use(sixtySClientToken), { text: String(params.text), to: args[0] != null ? String(args[0]) : undefined }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/fuel-price.js";
5
5
  export default defineCommand({
6
- description: '今日油价',
6
+ description: '今日油价', descriptionI18n: { en: "Today's fuel prices" },
7
7
  params: { province: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { province: params.province != null ? String(params.province) : undefined }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { province: params.province != null ? String(params.province) : undefined }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/fuel-price.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '今日油价',
6
+ description: '今日油价', descriptionI18n: { en: "Today's fuel prices" },
7
7
  params: { province: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { province: params.province != null ? String(params.province) : undefined }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { province: params.province != null ? String(params.province) : undefined }, locale),
9
9
  });
@@ -3,6 +3,6 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/gold-price.js";
5
5
  export default defineCommand({
6
- description: '今日金价',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '今日金价', descriptionI18n: { en: "Today's gold prices" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/gold-price.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '今日金价',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '今日金价', descriptionI18n: { en: "Today's gold prices" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/history-today.js";
5
5
  export default defineCommand({
6
- description: '历史上的今天',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '历史上的今天', descriptionI18n: { en: "Today in history" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/history-today.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '历史上的今天',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '历史上的今天', descriptionI18n: { en: "Today in history" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/hitokoto.js";
5
5
  export default defineCommand({
6
- description: '随机一言',
6
+ description: '随机一言', descriptionI18n: { en: "Random quotation" },
7
7
  params: { type: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { type: params.type != null ? String(params.type) : undefined }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { type: params.type != null ? String(params.type) : undefined }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/hitokoto.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '随机一言',
6
+ description: '随机一言', descriptionI18n: { en: "Random quotation" },
7
7
  params: { type: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { type: params.type != null ? String(params.type) : undefined }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { type: params.type != null ? String(params.type) : undefined }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/ip-query.js";
5
5
  export default defineCommand({
6
- description: 'IP 查询',
6
+ description: 'IP 查询', descriptionI18n: { en: "Look up an IP address" },
7
7
  params: { ip: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { ip: params.ip != null ? String(params.ip) : undefined }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { ip: params.ip != null ? String(params.ip) : undefined }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/ip-query.js';
4
4
 
5
5
  export default defineCommand({
6
- description: 'IP 查询',
6
+ description: 'IP 查询', descriptionI18n: { en: "Look up an IP address" },
7
7
  params: { ip: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { ip: params.ip != null ? String(params.ip) : undefined }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { ip: params.ip != null ? String(params.ip) : undefined }, locale),
9
9
  });
@@ -3,6 +3,6 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/kfc.js";
5
5
  export default defineCommand({
6
- description: 'KFC 文案',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: 'KFC 文案', descriptionI18n: { en: "KFC copywriting" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/kfc.js';
4
4
 
5
5
  export default defineCommand({
6
- description: 'KFC 文案',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: 'KFC 文案', descriptionI18n: { en: "KFC copywriting" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../lib/client.js";
4
4
  import handler from "../../lib/handlers/moyu.js";
5
5
  export default defineCommand({
6
- description: '摸鱼日历',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '摸鱼日历', descriptionI18n: { en: "Daily leisure calendar" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,6 +3,6 @@ import { sixtySClientToken } from '../../src/client.js';
3
3
  import handler from '../../src/handlers/moyu.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '摸鱼日历',
7
- execute: ({ use }) => handler(use(sixtySClientToken)),
6
+ description: '摸鱼日历', descriptionI18n: { en: "Daily leisure calendar" },
7
+ execute: ({ use, locale }) => handler(use(sixtySClientToken), locale),
8
8
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/toutiao-hot.js";
5
5
  export default defineCommand({
6
- description: '头条热搜',
6
+ description: '头条热搜', descriptionI18n: { en: "Toutiao trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/toutiao-hot.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '头条热搜',
6
+ description: '头条热搜', descriptionI18n: { en: "Toutiao trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/weather.js";
5
5
  export default defineCommand({
6
- description: '查询城市天气',
6
+ description: '查询城市天气', descriptionI18n: { en: "Look up city weather" },
7
7
  params: { city: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { city: String(params.city) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { city: String(params.city) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/weather.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '查询城市天气',
6
+ description: '查询城市天气', descriptionI18n: { en: "Look up city weather" },
7
7
  params: { city: { type: 'string' } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { city: String(params.city) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { city: String(params.city) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/weibo-hot.js";
5
5
  export default defineCommand({
6
- description: '微博热搜',
6
+ description: '微博热搜', descriptionI18n: { en: "Weibo trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/weibo-hot.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '微博热搜',
6
+ description: '微博热搜', descriptionI18n: { en: "Weibo trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { defineCommand } from 'zhin.js/command';
3
3
  import { sixtySClientToken } from "../../../lib/client.js";
4
4
  import handler from "../../../lib/handlers/zhihu-hot.js";
5
5
  export default defineCommand({
6
- description: '知乎热榜',
6
+ description: '知乎热榜', descriptionI18n: { en: "Zhihu trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
@@ -3,7 +3,7 @@ import { sixtySClientToken } from '../../../src/client.js';
3
3
  import handler from '../../../src/handlers/zhihu-hot.js';
4
4
 
5
5
  export default defineCommand({
6
- description: '知乎热榜',
6
+ description: '知乎热榜', descriptionI18n: { en: "Zhihu trending topics" },
7
7
  params: { limit: { type: 'number', default: 10 } },
8
- execute: ({ params, use }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }),
8
+ execute: ({ params, use, locale }) => handler(use(sixtySClientToken), { limit: Number(params.limit) }, locale),
9
9
  });
package/lib/client.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { Locale } from 'zhin.js/i18n';
1
2
  export declare const DEFAULT_API_BASE = "https://60s.viki.moe";
2
3
  export type SixtySApiBase = () => string | undefined;
3
4
  /** Owner-scoped transport for one 60s plugin instance. */
@@ -5,7 +6,7 @@ export declare class SixtySClient {
5
6
  #private;
6
7
  constructor(getApiBase: SixtySApiBase);
7
8
  get apiBase(): string;
8
- fetch<T = Record<string, unknown>>(endpoint: string, params?: Readonly<Record<string, string>>): Promise<T>;
9
+ fetch<T = Record<string, unknown>>(endpoint: string, params?: Readonly<Record<string, string>>, locale?: Locale): Promise<T>;
9
10
  }
10
11
  export declare const sixtySClientToken: import("zhin.js").Token<SixtySClient>;
11
12
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,MAAM,MAAM,GAAG,SAAS,CAAC;AAErD,0DAA0D;AAC1D,qBAAa,YAAY;;gBAGX,UAAU,EAAE,aAAa;IAIrC,IAAI,OAAO,IAAI,MAAM,CAEpB;IAEK,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC;CAmCd;AAED,eAAO,MAAM,iBAAiB,uCAG7B,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,MAAM,MAAM,GAAG,SAAS,CAAC;AAErD,0DAA0D;AAC1D,qBAAa,YAAY;;gBAGX,UAAU,EAAE,aAAa;IAIrC,IAAI,OAAO,IAAI,MAAM,CAEpB;IAEK,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,CAAC,CAAC;CAmCd;AAED,eAAO,MAAM,iBAAiB,uCAG7B,CAAC"}
package/lib/client.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { messages as t } from './i18n.js';
1
2
  import { createToken } from 'zhin.js';
2
3
  export const DEFAULT_API_BASE = 'https://60s.viki.moe';
3
4
  /** Owner-scoped transport for one 60s plugin instance. */
@@ -9,7 +10,7 @@ export class SixtySClient {
9
10
  get apiBase() {
10
11
  return this.#getApiBase()?.trim().replace(/\/$/u, '') || DEFAULT_API_BASE;
11
12
  }
12
- async fetch(endpoint, params) {
13
+ async fetch(endpoint, params, locale) {
13
14
  const url = new URL(`${this.apiBase}/v2${endpoint}`);
14
15
  for (const [key, value] of Object.entries(params ?? {})) {
15
16
  url.searchParams.set(key, value);
@@ -20,20 +21,20 @@ export class SixtySClient {
20
21
  }
21
22
  catch (error) {
22
23
  const cause = error;
23
- throw new Error(cause.name === 'TimeoutError' ? '请求超时(30s)' : `请求失败: ${cause.message}`, { cause: error });
24
+ throw new Error(cause.name === 'TimeoutError' ? t(locale, 'requestTimeout') : t(locale, 'requestFailed', { detail: cause.message }), { cause: error });
24
25
  }
25
26
  if (!response.ok) {
26
- throw new Error(`API 请求失败: ${response.status} ${response.statusText}`);
27
+ throw new Error(t(locale, 'httpError', { status: response.status, text: response.statusText }));
27
28
  }
28
29
  const contentType = response.headers.get('content-type') ?? '';
29
30
  if (!contentType.includes('application/json')) {
30
- throw new Error(`API 返回非 JSON 响应 (content-type: ${contentType || 'unknown'})`);
31
+ throw new Error(t(locale, 'jsonError', { type: contentType || 'unknown' }));
31
32
  }
32
33
  const envelope = (await response.json());
33
34
  if (envelope.error)
34
35
  throw new Error(envelope.error);
35
36
  if (envelope.code !== undefined && envelope.code !== 200 && envelope.code !== 0) {
36
- throw new Error(envelope.message || envelope.msg || `API 错误: ${envelope.code}`);
37
+ throw new Error(envelope.message || envelope.msg || t(locale, 'apiError', { code: envelope.code }));
37
38
  }
38
39
  return (envelope.data ?? envelope);
39
40
  }
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAIvD,0DAA0D;AAC1D,MAAM,OAAO,YAAY;IACd,WAAW,CAAgB;IAEpC,YAAY,UAAyB;QACnC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,gBAAgB,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,KAAK,CACT,QAAgB,EAChB,MAAyC;QAEzC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,MAAM,QAAQ,EAAE,CAAC,CAAC;QACrD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC;QACD,IAA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CAAC,GAAG,IAAI,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACtG,CAAC;QACD,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAM,CAAC;IAC1C,CAAC;CACF;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAC1C,qBAAqB,EACrB,6BAA6B,CAC9B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { Locale } from 'zhin.js/i18n';
1
2
  import type { SixtySClient } from '../client.js';
2
- export default function (client: SixtySClient): Promise<string>;
3
+ export default function (client: SixtySClient, locale?: Locale): Promise<string>;
3
4
  //# sourceMappingURL=60s-news.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"60s-news.d.ts","sourceRoot":"","sources":["../../src/handlers/60s-news.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAQlD"}
1
+ {"version":3,"file":"60s-news.d.ts","sourceRoot":"","sources":["../../src/handlers/60s-news.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,mBAQnE"}
@@ -1,6 +1,7 @@
1
- export default async function (client) {
2
- const data = await client.fetch('/60s');
3
- const lines = [`📰 今日60秒新闻 (${data.date || ''})`, ''];
1
+ import { messages as t } from '../i18n.js';
2
+ export default async function (client, locale) {
3
+ const data = await client.fetch('/60s', undefined, locale);
4
+ const lines = [t(locale, 'news', { date: String(data.date || '') }), ''];
4
5
  if (data.news && Array.isArray(data.news)) {
5
6
  lines.push(...data.news.map((n, i) => `${i + 1}. ${n}`));
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"60s-news.js","sourceRoot":"","sources":["../../src/handlers/60s-news.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB;IACjD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,CAAC,eAAe,IAAI,CAAC,IAAI,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IACtD,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,IAAI,CAAC,GAAG;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"60s-news.js","sourceRoot":"","sources":["../../src/handlers/60s-news.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC;AAG3C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB,EAAE,MAAe;IAClE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3D,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACzE,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,IAAI,CAAC,GAAG;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { Locale } from 'zhin.js/i18n';
1
2
  import type { SixtySClient } from '../client.js';
2
- export default function (client: SixtySClient): Promise<string>;
3
+ export default function (client: SixtySClient, locale?: Locale): Promise<string>;
3
4
  //# sourceMappingURL=bing-image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bing-image.d.ts","sourceRoot":"","sources":["../../src/handlers/bing-image.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAUlD"}
1
+ {"version":3,"file":"bing-image.d.ts","sourceRoot":"","sources":["../../src/handlers/bing-image.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,mBAUnE"}
@@ -1,7 +1,8 @@
1
+ import { messages as t } from '../i18n.js';
1
2
  import { asString } from '../api.js';
2
- export default async function (client) {
3
- const data = await client.fetch('/bing');
4
- const lines = ['🖼️ Bing 每日壁纸', ''];
3
+ export default async function (client, locale) {
4
+ const data = await client.fetch('/bing', undefined, locale);
5
+ const lines = [t(locale, 'bing'), ''];
5
6
  if (data.title)
6
7
  lines.push(`📌 ${data.title}`);
7
8
  if (data.headline)
@@ -1 +1 @@
1
- {"version":3,"file":"bing-image.js","sourceRoot":"","sources":["../../src/handlers/bing-image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB;IACjD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IACpC,IAAI,IAAI,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/C,IAAI,IAAI,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACvD,IAAI,IAAI,CAAC,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC;IACrE,IAAI,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"bing-image.js","sourceRoot":"","sources":["../../src/handlers/bing-image.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB,EAAE,MAAe;IAClE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;IACtC,IAAI,IAAI,CAAC,KAAK;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/C,IAAI,IAAI,CAAC,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IACvD,IAAI,IAAI,CAAC,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC;IACrE,IAAI,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,5 +1,6 @@
1
+ import type { Locale } from 'zhin.js/i18n';
1
2
  import type { SixtySClient } from '../client.js';
2
3
  export default function (client: SixtySClient, args: {
3
4
  limit?: number;
4
- }): Promise<string>;
5
+ }, locale?: Locale): Promise<string>;
5
6
  //# sourceMappingURL=douyin-hot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"douyin-hot.d.ts","sourceRoot":"","sources":["../../src/handlers/douyin-hot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,mBAG5E"}
1
+ {"version":3,"file":"douyin-hot.d.ts","sourceRoot":"","sources":["../../src/handlers/douyin-hot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,CAAC,EAAE,MAAM,mBAG7F"}
@@ -1,6 +1,7 @@
1
+ import { messages as t } from '../i18n.js';
1
2
  import { formatList } from '../api.js';
2
- export default async function (client, args) {
3
- const data = await client.fetch('/douyin');
4
- return ['🔥 抖音热搜', '', formatList(data, args.limit || 10)].join('\n');
3
+ export default async function (client, args, locale) {
4
+ const data = await client.fetch('/douyin', undefined, locale);
5
+ return [t(locale, 'douyin'), '', formatList(data, args.limit || 10)].join('\n');
5
6
  }
6
7
  //# sourceMappingURL=douyin-hot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"douyin-hot.js","sourceRoot":"","sources":["../../src/handlers/douyin-hot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,WAAW,CAAC;AAGtD,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB,EAAE,IAAwB;IAC3E,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAa,SAAS,CAAC,CAAC;IACvD,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxE,CAAC"}
1
+ {"version":3,"file":"douyin-hot.js","sourceRoot":"","sources":["../../src/handlers/douyin-hot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAiB,MAAM,WAAW,CAAC;AAGtD,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB,EAAE,IAAwB,EAAE,MAAe;IAC5F,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAa,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1E,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClF,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { Locale } from 'zhin.js/i18n';
1
2
  import type { SixtySClient } from '../client.js';
2
- export default function (client: SixtySClient): Promise<string>;
3
+ export default function (client: SixtySClient, locale?: Locale): Promise<string>;
3
4
  //# sourceMappingURL=duanzi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"duanzi.d.ts","sourceRoot":"","sources":["../../src/handlers/duanzi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,mBAGlD"}
1
+ {"version":3,"file":"duanzi.d.ts","sourceRoot":"","sources":["../../src/handlers/duanzi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,yBAA+B,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,mBAGnE"}
@@ -1,5 +1,6 @@
1
- export default async function (client) {
2
- const data = await client.fetch('/duanzi');
3
- return `😂 段子\n\n${data.duanzi || data.content || data.text || (typeof data === 'string' ? data : '')}`;
1
+ import { messages as t } from '../i18n.js';
2
+ export default async function (client, locale) {
3
+ const data = await client.fetch('/duanzi', undefined, locale);
4
+ return `${t(locale, 'duanzi')}\n\n${data.duanzi || data.content || data.text || (typeof data === 'string' ? data : '')}`;
4
5
  }
5
6
  //# sourceMappingURL=duanzi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"duanzi.js","sourceRoot":"","sources":["../../src/handlers/duanzi.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB;IACjD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,YAAY,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1G,CAAC"}
1
+ {"version":3,"file":"duanzi.js","sourceRoot":"","sources":["../../src/handlers/duanzi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC;AAG3C,MAAM,CAAC,OAAO,CAAC,KAAK,WAAW,MAAoB,EAAE,MAAe;IAClE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC9D,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC3H,CAAC"}