@juzi/wechaty 1.0.148 → 1.0.150
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/dist/cjs/src/mods/impls.d.ts +3 -3
- package/dist/cjs/src/mods/impls.d.ts.map +1 -1
- package/dist/cjs/src/mods/impls.js +2 -1
- package/dist/cjs/src/mods/impls.js.map +1 -1
- package/dist/cjs/src/mods/users.d.ts +1 -1
- package/dist/cjs/src/mods/users.d.ts.map +1 -1
- package/dist/cjs/src/package-json.js +4 -4
- package/dist/cjs/src/package-json.js.map +1 -1
- package/dist/cjs/src/user-modules/channel.d.ts +8 -0
- package/dist/cjs/src/user-modules/channel.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/channel.js +18 -0
- package/dist/cjs/src/user-modules/channel.js.map +1 -1
- package/dist/cjs/src/user-modules/message.d.ts +15 -0
- package/dist/cjs/src/user-modules/message.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/message.js +20 -0
- package/dist/cjs/src/user-modules/message.js.map +1 -1
- package/dist/cjs/src/user-modules/mod.d.ts +4 -3
- package/dist/cjs/src/user-modules/mod.d.ts.map +1 -1
- package/dist/cjs/src/user-modules/mod.js +3 -1
- package/dist/cjs/src/user-modules/mod.js.map +1 -1
- package/dist/cjs/src/user-modules/voice.d.ts +69 -0
- package/dist/cjs/src/user-modules/voice.d.ts.map +1 -0
- package/dist/cjs/src/user-modules/voice.js +64 -0
- package/dist/cjs/src/user-modules/voice.js.map +1 -0
- package/dist/cjs/src/wechaty/wechaty-base.d.ts +10 -0
- package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js +25 -23
- package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +12 -0
- package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +6 -0
- package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +8 -12
- package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +4 -0
- package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js +3 -0
- package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/dist/esm/src/mods/impls.d.ts +3 -3
- package/dist/esm/src/mods/impls.d.ts.map +1 -1
- package/dist/esm/src/mods/impls.js +1 -1
- package/dist/esm/src/mods/impls.js.map +1 -1
- package/dist/esm/src/mods/users.d.ts +1 -1
- package/dist/esm/src/mods/users.d.ts.map +1 -1
- package/dist/esm/src/package-json.js +4 -4
- package/dist/esm/src/package-json.js.map +1 -1
- package/dist/esm/src/user-modules/channel.d.ts +8 -0
- package/dist/esm/src/user-modules/channel.d.ts.map +1 -1
- package/dist/esm/src/user-modules/channel.js +18 -0
- package/dist/esm/src/user-modules/channel.js.map +1 -1
- package/dist/esm/src/user-modules/message.d.ts +15 -0
- package/dist/esm/src/user-modules/message.d.ts.map +1 -1
- package/dist/esm/src/user-modules/message.js +20 -0
- package/dist/esm/src/user-modules/message.js.map +1 -1
- package/dist/esm/src/user-modules/mod.d.ts +4 -3
- package/dist/esm/src/user-modules/mod.d.ts.map +1 -1
- package/dist/esm/src/user-modules/mod.js +2 -1
- package/dist/esm/src/user-modules/mod.js.map +1 -1
- package/dist/esm/src/user-modules/voice.d.ts +69 -0
- package/dist/esm/src/user-modules/voice.d.ts.map +1 -0
- package/dist/esm/src/user-modules/voice.js +61 -0
- package/dist/esm/src/user-modules/voice.js.map +1 -0
- package/dist/esm/src/wechaty/wechaty-base.d.ts +10 -0
- package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
- package/dist/esm/src/wechaty/wechaty-impl.spec.js +25 -23
- package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +12 -0
- package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +6 -0
- package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +8 -12
- package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +4 -0
- package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +4 -2
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js +4 -1
- package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
- package/package.json +3 -3
- package/src/mods/impls.ts +3 -0
- package/src/mods/users.ts +1 -0
- package/src/package-json.ts +4 -4
- package/src/user-modules/channel.ts +23 -0
- package/src/user-modules/message.ts +24 -0
- package/src/user-modules/mod.ts +8 -0
- package/src/user-modules/voice.ts +104 -0
- package/src/wechaty/wechaty-impl.spec.ts +3 -0
- package/src/wechaty-mixins/wechatify-user-module-mixin.ts +6 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wechatify-user-module-mixin.js","sourceRoot":"","sources":["../../../../src/wechaty-mixins/wechatify-user-module-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAe,sBAAsB,CAAA;AAEnD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,EACf,gCAAgC,EAChC,UAAU,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT,iCAAiC,EACjC,cAAc,EACd,eAAe,EACf,aAAa,
|
|
1
|
+
{"version":3,"file":"wechatify-user-module-mixin.js","sourceRoot":"","sources":["../../../../src/wechaty-mixins/wechatify-user-module-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAe,sBAAsB,CAAA;AAEnD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,eAAe,EACf,SAAS,EACT,cAAc,EACd,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,WAAW,EACX,eAAe,EACf,eAAe,EACf,gCAAgC,EAChC,UAAU,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT,iCAAiC,EACjC,cAAc,EACd,eAAe,EACf,aAAa,EA8Bb,mBAAmB,GACpB,MAA4B,wBAAwB,CAAA;AAMrD,MAAM,wBAAwB,GAAG,CAA4C,SAAoB,EAAE,EAAE;IACnG,GAAG,CAAC,OAAO,CAAC,0BAA0B,EAAE,8BAA8B,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;IAEvF,MAAe,wBAAyB,SAAQ,SAAS;QAEvD,YAAa,GAAG,IAAW;YACzB,GAAG,CAAC,OAAO,CAAC,0BAA0B,EAAE,eAAe,CAAC,CAAA;YACxD,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;QAChB,CAAC;QAED,iBAAiB,CAA4C;QAC7D,oBAAoB,CAA4C;QAChE,wBAAwB,CAA4C;QACpE,kBAAkB,CAA4C;QAC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@juzi/wechaty",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.150",
|
|
4
4
|
"description": "Wechaty is a RPA SDK for Chatbot Makers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
},
|
|
110
110
|
"homepage": "https://github.com/wechaty/",
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"@juzi/wechaty-puppet-service": "
|
|
112
|
+
"@juzi/wechaty-puppet-service": "1.0.118",
|
|
113
113
|
"clone-class": "^1.1.1",
|
|
114
114
|
"cmd-ts": "^0.10.0",
|
|
115
115
|
"cockatiel": "^2.0.2",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"@chatie/eslint-config": "^1.0.4",
|
|
133
133
|
"@chatie/semver": "^0.4.7",
|
|
134
134
|
"@chatie/tsconfig": "^4.6.3",
|
|
135
|
-
"@juzi/wechaty-puppet": "^1.0.
|
|
135
|
+
"@juzi/wechaty-puppet": "^1.0.142",
|
|
136
136
|
"@juzi/wechaty-puppet-mock": "^1.0.1",
|
|
137
137
|
"@swc/core": "1.3.44",
|
|
138
138
|
"@swc/helpers": "^0.3.6",
|
package/src/mods/impls.ts
CHANGED
|
@@ -37,6 +37,7 @@ export {
|
|
|
37
37
|
FavoriteImpl,
|
|
38
38
|
FriendshipImpl,
|
|
39
39
|
ImageImpl,
|
|
40
|
+
VoiceImpl,
|
|
40
41
|
LocationImpl,
|
|
41
42
|
MessageImpl,
|
|
42
43
|
MiniProgramImpl,
|
|
@@ -88,6 +89,7 @@ export type {
|
|
|
88
89
|
FavoriteInterface,
|
|
89
90
|
FriendshipInterface,
|
|
90
91
|
ImageInterface,
|
|
92
|
+
VoiceInterface,
|
|
91
93
|
LocationInterface,
|
|
92
94
|
MessageInterface,
|
|
93
95
|
MiniProgramInterface,
|
|
@@ -118,6 +120,7 @@ export type {
|
|
|
118
120
|
FavoriteConstructor,
|
|
119
121
|
FriendshipConstructor,
|
|
120
122
|
ImageConstructor,
|
|
123
|
+
VoiceConstructor,
|
|
121
124
|
LocationConstructor,
|
|
122
125
|
MessageConstructor,
|
|
123
126
|
MiniProgramConstructor,
|
package/src/mods/users.ts
CHANGED
package/src/package-json.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { PackageJsonWechaty } from './config'
|
|
6
6
|
|
|
7
|
-
export const GIT_COMMIT_HASH: string = '
|
|
7
|
+
export const GIT_COMMIT_HASH: string = 'e4d722bd21b4291abeec2865fb70f4b9b6406561'
|
|
8
8
|
export const packageJson: PackageJsonWechaty = {
|
|
9
9
|
"name": "@juzi/wechaty",
|
|
10
|
-
"version": "1.0.
|
|
10
|
+
"version": "1.0.150",
|
|
11
11
|
"description": "Wechaty is a RPA SDK for Chatbot Makers.",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"exports": {
|
|
@@ -116,7 +116,7 @@ export const packageJson: PackageJsonWechaty = {
|
|
|
116
116
|
},
|
|
117
117
|
"homepage": "https://github.com/wechaty/",
|
|
118
118
|
"dependencies": {
|
|
119
|
-
"@juzi/wechaty-puppet-service": "
|
|
119
|
+
"@juzi/wechaty-puppet-service": "1.0.118",
|
|
120
120
|
"clone-class": "^1.1.1",
|
|
121
121
|
"cmd-ts": "^0.10.0",
|
|
122
122
|
"cockatiel": "^2.0.2",
|
|
@@ -139,7 +139,7 @@ export const packageJson: PackageJsonWechaty = {
|
|
|
139
139
|
"@chatie/eslint-config": "^1.0.4",
|
|
140
140
|
"@chatie/semver": "^0.4.7",
|
|
141
141
|
"@chatie/tsconfig": "^4.6.3",
|
|
142
|
-
"@juzi/wechaty-puppet": "^1.0.
|
|
142
|
+
"@juzi/wechaty-puppet": "^1.0.142",
|
|
143
143
|
"@juzi/wechaty-puppet-mock": "^1.0.1",
|
|
144
144
|
"@swc/core": "1.3.44",
|
|
145
145
|
"@swc/helpers": "^0.3.6",
|
|
@@ -84,6 +84,29 @@ class ChannelMixin extends wechatifyMixinBase() {
|
|
|
84
84
|
return this.payload.objectNonceId
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* 个微转发视频号所需补充字段
|
|
89
|
+
*/
|
|
90
|
+
username (): undefined | string {
|
|
91
|
+
return this.payload.username
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
authIconType (): undefined | number {
|
|
95
|
+
return this.payload.authIconType
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
authIconUrl (): undefined | string {
|
|
99
|
+
return this.payload.authIconUrl
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
fromUserName (): undefined | string {
|
|
103
|
+
return this.payload.fromUserName
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
mediaList (): undefined | PUPPET.payloads.ChannelMedia[] {
|
|
107
|
+
return this.payload.mediaList
|
|
108
|
+
}
|
|
109
|
+
|
|
87
110
|
}
|
|
88
111
|
|
|
89
112
|
class ChannelImpl extends validationMixin(ChannelMixin)<ChannelInterface>() { }
|
|
@@ -62,6 +62,9 @@ import type {
|
|
|
62
62
|
import type {
|
|
63
63
|
ImageInterface,
|
|
64
64
|
} from './image.js'
|
|
65
|
+
import type {
|
|
66
|
+
VoiceInterface,
|
|
67
|
+
} from './voice.js'
|
|
65
68
|
import type {
|
|
66
69
|
PostInterface,
|
|
67
70
|
} from './post.js'
|
|
@@ -1419,6 +1422,27 @@ class MessageMixin extends MixinBase implements SayableSayer {
|
|
|
1419
1422
|
return this.wechaty.Image.create(this.id)
|
|
1420
1423
|
}
|
|
1421
1424
|
|
|
1425
|
+
/**
|
|
1426
|
+
* Extract the Voice from the Message, so that we can asynchronously fetch the
|
|
1427
|
+
* voice file and the voice-to-text (ASR) result via second requests.
|
|
1428
|
+
* > Tips:
|
|
1429
|
+
* This function is depending on the Puppet Implementation, see [puppet-compatible-table](https://github.com/wechaty/wechaty/wiki/Puppet#3-puppet-compatible-table)
|
|
1430
|
+
*
|
|
1431
|
+
* @returns {VoiceInterface}
|
|
1432
|
+
*
|
|
1433
|
+
* @example <caption>Get voice file and text from a voice message</caption>
|
|
1434
|
+
* const voice = message.toVoice()
|
|
1435
|
+
* const fileBox = await voice.file()
|
|
1436
|
+
* const { text, noSpeech } = await voice.text()
|
|
1437
|
+
*/
|
|
1438
|
+
toVoice (): VoiceInterface {
|
|
1439
|
+
log.verbose('Message', 'toVoice() for message id: %s', this.id)
|
|
1440
|
+
if (this.type() !== PUPPET.types.Message.Audio) {
|
|
1441
|
+
throw new Error(`not a voice type message. type: ${this.type()}`)
|
|
1442
|
+
}
|
|
1443
|
+
return this.wechaty.Voice.create(this.id)
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1422
1446
|
async toPreview (): Promise<FileBoxInterface | undefined> {
|
|
1423
1447
|
log.verbose('Message', 'toPreview() for message id: %s', this.id)
|
|
1424
1448
|
if (!ALLOW_PREVIEW_TYPES.some(e => e === this.type())) {
|
package/src/user-modules/mod.ts
CHANGED
|
@@ -42,6 +42,11 @@ import {
|
|
|
42
42
|
ImageInterface,
|
|
43
43
|
ImageConstructor,
|
|
44
44
|
} from './image.js'
|
|
45
|
+
import {
|
|
46
|
+
VoiceImpl,
|
|
47
|
+
VoiceInterface,
|
|
48
|
+
VoiceConstructor,
|
|
49
|
+
} from './voice.js'
|
|
45
50
|
import {
|
|
46
51
|
LocationImpl,
|
|
47
52
|
LocationInterface,
|
|
@@ -175,6 +180,7 @@ export type {
|
|
|
175
180
|
FavoriteInterface,
|
|
176
181
|
FriendshipInterface,
|
|
177
182
|
ImageInterface,
|
|
183
|
+
VoiceInterface,
|
|
178
184
|
LocationInterface,
|
|
179
185
|
MessageInterface,
|
|
180
186
|
MiniProgramInterface,
|
|
@@ -207,6 +213,7 @@ export type {
|
|
|
207
213
|
FavoriteConstructor,
|
|
208
214
|
FriendshipConstructor,
|
|
209
215
|
ImageConstructor,
|
|
216
|
+
VoiceConstructor,
|
|
210
217
|
LocationConstructor,
|
|
211
218
|
MessageConstructor,
|
|
212
219
|
MiniProgramConstructor,
|
|
@@ -241,6 +248,7 @@ export {
|
|
|
241
248
|
FavoriteImpl,
|
|
242
249
|
FriendshipImpl,
|
|
243
250
|
ImageImpl,
|
|
251
|
+
VoiceImpl,
|
|
244
252
|
LocationImpl,
|
|
245
253
|
MessageImpl,
|
|
246
254
|
MiniProgramImpl,
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wechaty Chatbot SDK - https://github.com/wechaty/wechaty
|
|
3
|
+
*
|
|
4
|
+
* @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
|
5
|
+
* Wechaty Contributors <https://github.com/wechaty>.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
import type {
|
|
21
|
+
FileBoxInterface,
|
|
22
|
+
} from 'file-box'
|
|
23
|
+
import type { Constructor } from 'clone-class'
|
|
24
|
+
import { validationMixin } from '../user-mixins/validation.js'
|
|
25
|
+
import { log } from '../config.js'
|
|
26
|
+
|
|
27
|
+
import {
|
|
28
|
+
wechatifyMixinBase,
|
|
29
|
+
} from '../user-mixins/wechatify.js'
|
|
30
|
+
|
|
31
|
+
class VoiceMixin extends wechatifyMixinBase() {
|
|
32
|
+
|
|
33
|
+
static create (id: string): VoiceInterface {
|
|
34
|
+
log.verbose('Voice', 'static create(%s)', id)
|
|
35
|
+
|
|
36
|
+
const voice = new this(id)
|
|
37
|
+
return voice
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
constructor (
|
|
41
|
+
public id: string,
|
|
42
|
+
) {
|
|
43
|
+
super()
|
|
44
|
+
log.verbose('Voice', 'constructor(%s)', id)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the voice file (FileBox) via the puppet's dedicated `messageVoice` RPC.
|
|
49
|
+
*
|
|
50
|
+
* Falls back to the generic `messageFile` when the puppet does not implement
|
|
51
|
+
* `messageVoice` (old puppet without the new RPC → rejection), keeping the
|
|
52
|
+
* behaviour compatible with the legacy "voice file via messageFile" path.
|
|
53
|
+
*/
|
|
54
|
+
async file (): Promise<FileBoxInterface> {
|
|
55
|
+
log.verbose('Voice', 'file() for id: "%s"', this.id)
|
|
56
|
+
try {
|
|
57
|
+
const fileBox = await this.wechaty.puppet.messageVoice(this.id)
|
|
58
|
+
return fileBox
|
|
59
|
+
} catch (e) {
|
|
60
|
+
log.verbose('Voice', 'file() messageVoice() failed, fallback to messageFile(): %s', (e as Error).message)
|
|
61
|
+
const fileBox = await this.wechaty.puppet.messageFile(this.id)
|
|
62
|
+
return fileBox
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get the voice-to-text (ASR) result via the puppet's dedicated
|
|
68
|
+
* `messageVoiceText` RPC. Returns a discriminated result so the bot can tell
|
|
69
|
+
* "confirmed no speech" (`noSpeech=true`) from "normal transcription".
|
|
70
|
+
*
|
|
71
|
+
* Falls back to reading the legacy `messagePayload().text` when the puppet
|
|
72
|
+
* does not implement `messageVoiceText` (old puppet without the new RPC →
|
|
73
|
+
* rejection). Old puppets put the ASR result into `payload.text`, so this
|
|
74
|
+
* keeps the behaviour compatible; `noSpeech` is `false` in the fallback.
|
|
75
|
+
*/
|
|
76
|
+
async text (): Promise<{ text: string; noSpeech: boolean }> {
|
|
77
|
+
log.verbose('Voice', 'text() for id: "%s"', this.id)
|
|
78
|
+
try {
|
|
79
|
+
const payload = await this.wechaty.puppet.messageVoiceText(this.id)
|
|
80
|
+
return payload
|
|
81
|
+
} catch (e) {
|
|
82
|
+
log.verbose('Voice', 'text() messageVoiceText() failed, fallback to messagePayload().text: %s', (e as Error).message)
|
|
83
|
+
const payload = await this.wechaty.puppet.messagePayload(this.id)
|
|
84
|
+
return { text: payload.text || '', noSpeech: false }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class VoiceImpl extends validationMixin(VoiceMixin)<VoiceInterface>() {}
|
|
91
|
+
interface VoiceInterface extends VoiceImpl { }
|
|
92
|
+
|
|
93
|
+
type VoiceConstructor = Constructor<
|
|
94
|
+
VoiceInterface,
|
|
95
|
+
typeof VoiceImpl
|
|
96
|
+
>
|
|
97
|
+
|
|
98
|
+
export type {
|
|
99
|
+
VoiceConstructor,
|
|
100
|
+
VoiceInterface,
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
VoiceImpl,
|
|
104
|
+
}
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
ContactConstructor,
|
|
10
10
|
FriendshipConstructor,
|
|
11
11
|
ImageConstructor,
|
|
12
|
+
VoiceConstructor,
|
|
12
13
|
LocationConstructor,
|
|
13
14
|
MessageConstructor,
|
|
14
15
|
MiniProgramConstructor,
|
|
@@ -51,6 +52,7 @@ test('Wechaty interface', async t => {
|
|
|
51
52
|
Delay : DelayConstructor
|
|
52
53
|
Friendship : FriendshipConstructor
|
|
53
54
|
Image : ImageConstructor
|
|
55
|
+
Voice : VoiceConstructor
|
|
54
56
|
Location : LocationConstructor
|
|
55
57
|
Message : MessageConstructor
|
|
56
58
|
MiniProgram : MiniProgramConstructor
|
|
@@ -82,6 +84,7 @@ test('Wechaty interface', async t => {
|
|
|
82
84
|
= this.Delay
|
|
83
85
|
= this.Friendship
|
|
84
86
|
= this.Image
|
|
87
|
+
= this.Voice
|
|
85
88
|
= this.Location
|
|
86
89
|
= this.Message
|
|
87
90
|
= this.MiniProgram
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
DelayImpl,
|
|
8
8
|
FriendshipImpl,
|
|
9
9
|
ImageImpl,
|
|
10
|
+
VoiceImpl,
|
|
10
11
|
LocationImpl,
|
|
11
12
|
MessageImpl,
|
|
12
13
|
MiniProgramImpl,
|
|
@@ -35,6 +36,7 @@ import {
|
|
|
35
36
|
DelayConstructor,
|
|
36
37
|
FriendshipConstructor,
|
|
37
38
|
ImageConstructor,
|
|
39
|
+
VoiceConstructor,
|
|
38
40
|
LocationConstructor,
|
|
39
41
|
MessageConstructor,
|
|
40
42
|
MiniProgramConstructor,
|
|
@@ -79,6 +81,7 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
79
81
|
__wechatifiedDelay? : DelayConstructor
|
|
80
82
|
__wechatifiedFriendship? : FriendshipConstructor
|
|
81
83
|
__wechatifiedImage? : ImageConstructor
|
|
84
|
+
__wechatifiedVoice? : VoiceConstructor
|
|
82
85
|
__wechatifiedLocation? : LocationConstructor
|
|
83
86
|
__wechatifiedMessage? : MessageConstructor
|
|
84
87
|
__wechatifiedMiniProgram? : MiniProgramConstructor
|
|
@@ -107,6 +110,7 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
107
110
|
get Delay () : DelayConstructor { return guardWechatify(this.__wechatifiedDelay) }
|
|
108
111
|
get Friendship () : FriendshipConstructor { return guardWechatify(this.__wechatifiedFriendship) }
|
|
109
112
|
get Image () : ImageConstructor { return guardWechatify(this.__wechatifiedImage) }
|
|
113
|
+
get Voice () : VoiceConstructor { return guardWechatify(this.__wechatifiedVoice) }
|
|
110
114
|
get Location () : LocationConstructor { return guardWechatify(this.__wechatifiedLocation) }
|
|
111
115
|
get Message () : MessageConstructor { return guardWechatify(this.__wechatifiedMessage) }
|
|
112
116
|
get MiniProgram () : MiniProgramConstructor { return guardWechatify(this.__wechatifiedMiniProgram) }
|
|
@@ -155,6 +159,7 @@ const wechatifyUserModuleMixin = <MixinBase extends typeof WechatySkeleton> (mix
|
|
|
155
159
|
this.__wechatifiedDelay = wechatifyUserModule(DelayImpl)(this as any)
|
|
156
160
|
this.__wechatifiedFriendship = wechatifyUserModule(FriendshipImpl)(this as any)
|
|
157
161
|
this.__wechatifiedImage = wechatifyUserModule(ImageImpl)(this as any)
|
|
162
|
+
this.__wechatifiedVoice = wechatifyUserModule(VoiceImpl)(this as any)
|
|
158
163
|
this.__wechatifiedLocation = wechatifyUserModule(LocationImpl)(this as any)
|
|
159
164
|
this.__wechatifiedMessage = wechatifyUserModule(MessageImpl)(this as any)
|
|
160
165
|
this.__wechatifiedMiniProgram = wechatifyUserModule(MiniProgramImpl)(this as any)
|
|
@@ -204,6 +209,7 @@ type ProtectedPropertyWechatifyUserModuleMixin =
|
|
|
204
209
|
| '__wechatifiedDelay'
|
|
205
210
|
| '__wechatifiedFriendship'
|
|
206
211
|
| '__wechatifiedImage'
|
|
212
|
+
| '__wechatifiedVoice'
|
|
207
213
|
| '__wechatifiedLocation'
|
|
208
214
|
| '__wechatifiedMessage'
|
|
209
215
|
| '__wechatifiedMiniProgram'
|