kokkoro-plugin-saucenao 1.0.0 → 1.0.2
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 +6 -3
- package/lib/service.js +1 -1
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -21,10 +21,13 @@ plugin
|
|
|
21
21
|
.command('search', 'group')
|
|
22
22
|
.sugar(/^搜图$/)
|
|
23
23
|
.action(async (ctx) => {
|
|
24
|
-
const { bot, option } = ctx;
|
|
24
|
+
const { bot, option, sender, group_id } = ctx;
|
|
25
|
+
const { user_id } = sender;
|
|
25
26
|
const scanner = new kokkoro_1.Scanner(bot);
|
|
26
27
|
await ctx.reply(`请发送你要搜索的图片 (●'◡'●)`);
|
|
27
|
-
const { url } = await scanner.nextImage(
|
|
28
|
+
const { url } = await scanner.nextImage({
|
|
29
|
+
user_id, group_id,
|
|
30
|
+
});
|
|
28
31
|
const results = await service.searchImage(url, option);
|
|
29
32
|
const results_length = results.length;
|
|
30
33
|
const forwardMessage = [];
|
|
@@ -32,7 +35,7 @@ plugin
|
|
|
32
35
|
const result = results[i];
|
|
33
36
|
const { site, similarity, thumbnail, authorName, url } = result;
|
|
34
37
|
const message = {
|
|
35
|
-
message: [
|
|
38
|
+
message: [`封面:\n`, kokkoro_1.segment.image(thumbnail), `\n平台:${site}\n相似度:${similarity}\n作者:${authorName}\n来源:${url}`],
|
|
36
39
|
user_id: ctx.self_id,
|
|
37
40
|
nickname: bot.nickname,
|
|
38
41
|
};
|
package/lib/service.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kokkoro-plugin-saucenao",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "SauceNAO 图片搜索",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/kokkorojs/kokkoro-plugin-saucenao#readme",
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/node": "^18.11.
|
|
24
|
-
"kokkoro": "^1.
|
|
23
|
+
"@types/node": "^18.11.18",
|
|
24
|
+
"kokkoro": "^1.3.0"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"lib",
|