dsh-qq-tools 0.9.5 → 0.10.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/README.md +23 -11
- package/cordis.patch.yml +1 -1
- package/lib/config.js +96 -0
- package/lib/images.js +420 -0
- package/lib/index.js +2 -1
- package/lib/mount-all.js +59 -0
- package/lib/observation.js +24 -0
- package/lib/onebot.js +32 -0
- package/lib/prompts.js +56 -0
- package/lib/qq-state.js +51 -0
- package/lib/render.js +49 -0
- package/lib/session.js +201 -0
- package/lib/shared.js +26 -3377
- package/lib/tools/avatar.js +54 -0
- package/lib/tools/faces.js +296 -0
- package/lib/tools/friends.js +559 -0
- package/lib/tools/groups.js +220 -0
- package/lib/tools/poke.js +41 -0
- package/lib/tools/private.js +190 -0
- package/lib/tools/qzone.js +569 -0
- package/lib/utils.js +73 -0
- package/lib/watchers/mentions.js +167 -0
- package/lib/watchers/poke.js +87 -0
- package/lib/watchers/private.js +95 -0
- package/lib/watchers/ws.js +61 -0
- package/package.json +98 -103
- package/tools/qq-favorite-faces/index.js +11 -10
- package/tools/qq-favorite-faces/locale/en.json +1 -1
- package/tools/qq-favorite-faces/locale/zh.json +1 -1
- package/tools/qq-friend-management/index.js +28 -28
- package/tools/qq-get-group-history/index.js +10 -8
- package/tools/qq-get-group-members/index.js +9 -8
- package/tools/qq-list-groups/index.js +9 -8
- package/tools/qq-private-chat/index.js +16 -20
- package/tools/qq-qzone/index.js +22 -22
- package/tools/qq-send-face/index.js +11 -8
- package/tools/qq-send-face/locale/en.json +1 -1
- package/tools/qq-send-face/locale/zh.json +1 -1
- package/tools/qq-send-group-message/index.js +13 -10
- package/tools/qq-send-poke/index.js +13 -10
- package/tools/qq-set-avatar/index.js +9 -8
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
makeDeleteFriendTool,
|
|
3
|
-
makeGetFriendInfoTool,
|
|
4
|
-
makeHandleFriendRequestTool,
|
|
5
|
-
makeListFriendCategoriesTool,
|
|
6
|
-
makeListFriendRequestsTool,
|
|
7
|
-
makeSendLikeTool,
|
|
8
|
-
makeUpdateFriendTool,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from '../../lib/
|
|
12
|
-
|
|
13
|
-
export const name = 'qq-tools-friend-management'
|
|
14
|
-
export const inject = ['agents', 'timer', 'tools']
|
|
15
|
-
|
|
16
|
-
export function apply(ctx) {
|
|
17
|
-
const tools = [
|
|
18
|
-
mountOneTool(ctx, makeGetFriendInfoTool()),
|
|
19
|
-
mountOneTool(ctx, makeListFriendCategoriesTool()),
|
|
20
|
-
mountOneTool(ctx, makeUpdateFriendTool()),
|
|
21
|
-
mountOneTool(ctx, makeDeleteFriendTool()),
|
|
22
|
-
mountOneTool(ctx, makeSendLikeTool()),
|
|
23
|
-
mountOneTool(ctx, makeListFriendRequestsTool()),
|
|
24
|
-
mountOneTool(ctx, makeHandleFriendRequestTool()),
|
|
25
|
-
]
|
|
26
|
-
startFriendRequestWatcher(ctx)
|
|
27
|
-
return { tools }
|
|
28
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
makeDeleteFriendTool,
|
|
3
|
+
makeGetFriendInfoTool,
|
|
4
|
+
makeHandleFriendRequestTool,
|
|
5
|
+
makeListFriendCategoriesTool,
|
|
6
|
+
makeListFriendRequestsTool,
|
|
7
|
+
makeSendLikeTool,
|
|
8
|
+
makeUpdateFriendTool,
|
|
9
|
+
startFriendRequestWatcher,
|
|
10
|
+
} from '../../lib/tools/friends.js'
|
|
11
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
12
|
+
|
|
13
|
+
export const name = 'qq-tools-friend-management'
|
|
14
|
+
export const inject = ['agents', 'timer', 'tools']
|
|
15
|
+
|
|
16
|
+
export function apply(ctx) {
|
|
17
|
+
const tools = [
|
|
18
|
+
mountOneTool(ctx, makeGetFriendInfoTool()),
|
|
19
|
+
mountOneTool(ctx, makeListFriendCategoriesTool()),
|
|
20
|
+
mountOneTool(ctx, makeUpdateFriendTool()),
|
|
21
|
+
mountOneTool(ctx, makeDeleteFriendTool()),
|
|
22
|
+
mountOneTool(ctx, makeSendLikeTool()),
|
|
23
|
+
mountOneTool(ctx, makeListFriendRequestsTool()),
|
|
24
|
+
mountOneTool(ctx, makeHandleFriendRequestTool()),
|
|
25
|
+
]
|
|
26
|
+
startFriendRequestWatcher(ctx)
|
|
27
|
+
return { tools }
|
|
28
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { admitImagesFor
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { admitImagesFor } from '../../lib/images.js'
|
|
2
|
+
import { makeHistoryTool } from '../../lib/tools/groups.js'
|
|
3
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
4
|
+
|
|
5
|
+
export const name = 'qq-tools-group-history'
|
|
6
|
+
export const inject = ['agents', 'timer', 'tools', 'attachments']
|
|
7
|
+
|
|
8
|
+
export function apply(ctx) {
|
|
9
|
+
return mountOneTool(ctx, makeHistoryTool(admitImagesFor(ctx)))
|
|
10
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { makeMembersTool
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { makeMembersTool } from '../../lib/tools/groups.js'
|
|
2
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
3
|
+
|
|
4
|
+
export const name = 'qq-tools-group-members'
|
|
5
|
+
export const inject = ['agents', 'timer', 'tools']
|
|
6
|
+
|
|
7
|
+
export function apply(ctx) {
|
|
8
|
+
return mountOneTool(ctx, makeMembersTool())
|
|
9
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { makeListTool
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { makeListTool } from '../../lib/tools/groups.js'
|
|
2
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
3
|
+
|
|
4
|
+
export const name = 'qq-tools-list-groups'
|
|
5
|
+
export const inject = ['agents', 'timer', 'tools']
|
|
6
|
+
|
|
7
|
+
export function apply(ctx) {
|
|
8
|
+
return mountOneTool(ctx, makeListTool())
|
|
9
|
+
}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const send = mountOneTool(ctx, makeSendPrivateTool())
|
|
18
|
-
startPrivateWatcher(ctx, admitImages)
|
|
19
|
-
return { tools: [friends, history, send] }
|
|
20
|
-
}
|
|
1
|
+
import { admitImagesFor } from '../../lib/images.js'
|
|
2
|
+
import { makeListFriendsTool, makePrivateHistoryTool, makeSendPrivateTool } from '../../lib/tools/private.js'
|
|
3
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
4
|
+
import { startPrivateWatcher } from '../../lib/watchers/private.js'
|
|
5
|
+
|
|
6
|
+
export const name = 'qq-tools-private-chat'
|
|
7
|
+
export const inject = ['agents', 'timer', 'tools', 'attachments']
|
|
8
|
+
|
|
9
|
+
export function apply(ctx) {
|
|
10
|
+
const admitImages = admitImagesFor(ctx)
|
|
11
|
+
const friends = mountOneTool(ctx, makeListFriendsTool())
|
|
12
|
+
const history = mountOneTool(ctx, makePrivateHistoryTool(admitImages))
|
|
13
|
+
const send = mountOneTool(ctx, makeSendPrivateTool())
|
|
14
|
+
startPrivateWatcher(ctx, admitImages)
|
|
15
|
+
return { tools: [friends, history, send] }
|
|
16
|
+
}
|
package/tools/qq-qzone/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
makeGetQzonePostTool,
|
|
4
|
-
makeListQzoneTool,
|
|
5
|
-
makeManageQzoneTool,
|
|
6
|
-
makeSendQzonePostTool,
|
|
7
|
-
|
|
8
|
-
} from '../../lib/
|
|
9
|
-
|
|
10
|
-
export const name = 'qq-tools-qzone'
|
|
11
|
-
export const inject = ['agents', 'timer', 'tools', 'attachments']
|
|
12
|
-
|
|
13
|
-
export function apply(ctx) {
|
|
14
|
-
const admitImages = admitImagesFor(ctx)
|
|
15
|
-
const tools = [
|
|
16
|
-
mountOneTool(ctx, makeListQzoneTool(admitImages)),
|
|
17
|
-
mountOneTool(ctx, makeGetQzonePostTool(admitImages)),
|
|
18
|
-
mountOneTool(ctx, makeSendQzonePostTool()),
|
|
19
|
-
mountOneTool(ctx, makeManageQzoneTool()),
|
|
20
|
-
]
|
|
21
|
-
return { tools }
|
|
22
|
-
}
|
|
1
|
+
import { admitImagesFor } from '../../lib/images.js'
|
|
2
|
+
import {
|
|
3
|
+
makeGetQzonePostTool,
|
|
4
|
+
makeListQzoneTool,
|
|
5
|
+
makeManageQzoneTool,
|
|
6
|
+
makeSendQzonePostTool,
|
|
7
|
+
} from '../../lib/tools/qzone.js'
|
|
8
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
9
|
+
|
|
10
|
+
export const name = 'qq-tools-qzone'
|
|
11
|
+
export const inject = ['agents', 'timer', 'tools', 'attachments']
|
|
12
|
+
|
|
13
|
+
export function apply(ctx) {
|
|
14
|
+
const admitImages = admitImagesFor(ctx)
|
|
15
|
+
const tools = [
|
|
16
|
+
mountOneTool(ctx, makeListQzoneTool(admitImages)),
|
|
17
|
+
mountOneTool(ctx, makeGetQzonePostTool(admitImages)),
|
|
18
|
+
mountOneTool(ctx, makeSendQzonePostTool()),
|
|
19
|
+
mountOneTool(ctx, makeManageQzoneTool()),
|
|
20
|
+
]
|
|
21
|
+
return { tools }
|
|
22
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { admitImagesFor } from '../../lib/images.js'
|
|
2
|
+
import { makeSendFaceTool } from '../../lib/tools/faces.js'
|
|
3
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
4
|
+
import { startObservation } from '../../lib/observation.js'
|
|
5
|
+
|
|
6
|
+
export const name = 'qq-tools-send-face'
|
|
7
|
+
export const inject = ['agents', 'timer', 'tools', 'attachments']
|
|
8
|
+
|
|
9
|
+
export function apply(ctx) {
|
|
10
|
+
return mountOneTool(ctx, makeSendFaceTool(startObservation, admitImagesFor(ctx)))
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Send face",
|
|
4
|
-
"description": "Send a QQ
|
|
4
|
+
"description": "Send a saved QQ custom face to a group or private chat, optionally with a line of text; preview the image before sending."
|
|
5
5
|
}
|
|
6
6
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { makeSendTool
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { makeSendTool } from '../../lib/tools/groups.js'
|
|
2
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
3
|
+
import { startMentionPolling } from '../../lib/watchers/mentions.js'
|
|
4
|
+
import { startObservation } from '../../lib/observation.js'
|
|
5
|
+
|
|
6
|
+
export const name = 'qq-tools-send-group-message'
|
|
7
|
+
export const inject = ['agents', 'timer', 'tools']
|
|
8
|
+
|
|
9
|
+
export function apply(ctx) {
|
|
10
|
+
const mounted = mountOneTool(ctx, makeSendTool(startObservation))
|
|
11
|
+
startMentionPolling(ctx)
|
|
12
|
+
return mounted
|
|
13
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { makePokeTool
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { makePokeTool } from '../../lib/tools/poke.js'
|
|
2
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
3
|
+
import { startObservation } from '../../lib/observation.js'
|
|
4
|
+
import { startPokeWatcher } from '../../lib/watchers/poke.js'
|
|
5
|
+
|
|
6
|
+
export const name = 'qq-tools-send-poke'
|
|
7
|
+
export const inject = ['agents', 'timer', 'tools']
|
|
8
|
+
|
|
9
|
+
export function apply(ctx) {
|
|
10
|
+
const mounted = mountOneTool(ctx, makePokeTool(startObservation))
|
|
11
|
+
startPokeWatcher(ctx)
|
|
12
|
+
return mounted
|
|
13
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { makeSetAvatarTool
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { makeSetAvatarTool } from '../../lib/tools/avatar.js'
|
|
2
|
+
import { mountOneTool } from '../../lib/session.js'
|
|
3
|
+
|
|
4
|
+
export const name = 'qq-tools-set-avatar'
|
|
5
|
+
export const inject = ['agents', 'timer', 'tools']
|
|
6
|
+
|
|
7
|
+
export function apply(ctx) {
|
|
8
|
+
return mountOneTool(ctx, makeSetAvatarTool())
|
|
9
|
+
}
|