koishi-plugin-stock 1.0.9 → 1.0.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.
- package/README.md +3 -0
- package/lib/index.js +22 -8
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/index.js
CHANGED
|
@@ -161,10 +161,17 @@ function apply(ctx, config) {
|
|
|
161
161
|
return '您已被加入黑名单,无法使用此功能。';
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
164
|
-
//
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
// 读取本地图片文件并转换为base64
|
|
165
|
+
const fs = require('fs').promises;
|
|
166
|
+
const path = require('path');
|
|
167
|
+
// 构建图片的绝对路径
|
|
168
|
+
const imagePath = path.resolve(__dirname, '../images/qi.jpeg');
|
|
169
|
+
// 读取图片文件
|
|
170
|
+
const imageData = await fs.readFile(imagePath);
|
|
171
|
+
// 将图片数据转换为base64编码
|
|
172
|
+
const base64Image = imageData.toString('base64');
|
|
173
|
+
// 返回base64编码的图片
|
|
174
|
+
return `<img src="data:image/jpeg;base64,${base64Image}" />`;
|
|
168
175
|
}
|
|
169
176
|
catch (error) {
|
|
170
177
|
console.error('获取骑图片失败:', error);
|
|
@@ -279,10 +286,17 @@ function apply(ctx, config) {
|
|
|
279
286
|
return '您已被加入黑名单,无法使用此功能。';
|
|
280
287
|
}
|
|
281
288
|
try {
|
|
282
|
-
//
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
289
|
+
// 读取本地图片文件并转换为base64
|
|
290
|
+
const fs = require('fs').promises;
|
|
291
|
+
const path = require('path');
|
|
292
|
+
// 构建图片的绝对路径
|
|
293
|
+
const imagePath = path.resolve(__dirname, '../images/qi.jpeg');
|
|
294
|
+
// 读取图片文件
|
|
295
|
+
const imageData = await fs.readFile(imagePath);
|
|
296
|
+
// 将图片数据转换为base64编码
|
|
297
|
+
const base64Image = imageData.toString('base64');
|
|
298
|
+
// 返回base64编码的图片
|
|
299
|
+
return `<img src="data:image/jpeg;base64,${base64Image}" />`;
|
|
286
300
|
}
|
|
287
301
|
catch (error) {
|
|
288
302
|
console.error('获取骑图片失败:', error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-stock",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "A Koishi plugin that fetches stock data and provides market analysis, including active market cap, stock alerts, limit-up board, and stock selection features with configurable blacklists for each command.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|