wechat 0.11.6 → 0.11.7
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +6 -0
- data/README-CN.md +1 -0
- data/README.md +1 -0
- data/bin/wechat +5 -0
- data/lib/wechat.rb +1 -1
- data/lib/wechat/cipher.rb +1 -1
- data/lib/wechat/concern/common.rb +4 -0
- data/lib/wechat/mp_api.rb +4 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed7c19916af2b008eeb90cbd140261806457a679ac04fd1d7cafc741b5414494
|
4
|
+
data.tar.gz: a16c5a69bbd32d54263cf3fc15207a0c3278384f75239c3dc94fefa3952b8d68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76379f62522cf5eff64c0772a127a7e9ed4be8ceed0eba6710acc47f641c20404bccf039ac6383d0e61148e38171edb704b02f28c4a325dd68f79b83e9ba3dc7
|
7
|
+
data.tar.gz: da56c9242149a5a636975ad59bec0f1cb735b2d25ca2c06fec6125a972127f16c68dbdb2f114d208be3cc91a55cc582ea03dcce74360c67aa5a6865adde79642
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v0.11.7 (released at 11/15/2019)
|
4
|
+
|
5
|
+
* ADD: Wechat::MpApi.subscribe_message_send. by @paicha #271
|
6
|
+
* FIX: FrozenError: can't modify frozen String. by @paicha #272
|
7
|
+
* New translatecontent support.
|
8
|
+
|
3
9
|
## v0.11.6 (released at 09/02/2019)
|
4
10
|
|
5
11
|
* Fix private method `next_migration_number` introduced at #267, by @zpdsky #270
|
data/README-CN.md
CHANGED
@@ -392,6 +392,7 @@ Wechat Public Account commands:
|
|
392
392
|
wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字
|
393
393
|
wechat tags # 获取所有标签
|
394
394
|
wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口
|
395
|
+
wechat translatecontent [CONTENT] # AI开放接口-微信翻译
|
395
396
|
wechat user [OPEN_ID] # 获取用户基本信息
|
396
397
|
wechat user_batchget [OPEN_ID_LIST] # 批量获取用户基本信息
|
397
398
|
wechat user_change_group [OPEN_ID, TO_GROUP_ID] # 移动用户分组
|
data/README.md
CHANGED
@@ -423,6 +423,7 @@ Wechat Public Account commands:
|
|
423
423
|
wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字
|
424
424
|
wechat tags # 获取所有标签
|
425
425
|
wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口
|
426
|
+
wechat translatecontent [CONTENT] # AI开放接口-微信翻译
|
426
427
|
wechat user [OPEN_ID] # 获取用户基本信息
|
427
428
|
wechat user_batchget [OPEN_ID_LIST] # 批量获取用户基本信息
|
428
429
|
wechat user_change_group [OPEN_ID, TO_GROUP_ID] # 移动用户分组
|
data/bin/wechat
CHANGED
@@ -315,6 +315,11 @@ class App < Thor
|
|
315
315
|
def queryrecoresultfortext(voice_id)
|
316
316
|
puts wechat_api.queryrecoresultfortext(voice_id)
|
317
317
|
end
|
318
|
+
|
319
|
+
desc 'translatecontent [CONTENT]', 'AI开放接口-微信翻译'
|
320
|
+
def translatecontent(content)
|
321
|
+
puts wechat_api.translatecontent(content)
|
322
|
+
end
|
318
323
|
end
|
319
324
|
|
320
325
|
desc 'user [OPEN_ID]', '获取用户基本信息'
|
data/lib/wechat.rb
CHANGED
data/lib/wechat/cipher.rb
CHANGED
@@ -33,7 +33,7 @@ module Wechat
|
|
33
33
|
# app_id or corp_id
|
34
34
|
def pack(content, app_id)
|
35
35
|
random = SecureRandom.hex(8)
|
36
|
-
text = content.force_encoding('ASCII-8BIT')
|
36
|
+
text = content.dup.force_encoding('ASCII-8BIT')
|
37
37
|
msg_len = [text.length].pack('N')
|
38
38
|
|
39
39
|
encode_padding("#{random}#{msg_len}#{text}#{app_id}")
|
@@ -204,6 +204,10 @@ module Wechat
|
|
204
204
|
post 'media/voice/queryrecoresultfortext', nil, params: { voice_id: voice_id, lang: lang }
|
205
205
|
end
|
206
206
|
|
207
|
+
def translatecontent(from_content, lfrom = 'zh_CN', lto = 'en_US')
|
208
|
+
post 'media/voice/translatecontent', from_content, params: { lfrom: lfrom, lto: lto }
|
209
|
+
end
|
210
|
+
|
207
211
|
def web_access_token(code)
|
208
212
|
params = {
|
209
213
|
appid: access_token.appid,
|
data/lib/wechat/mp_api.rb
CHANGED
@@ -34,6 +34,10 @@ module Wechat
|
|
34
34
|
post 'wxopen/template/del', JSON.generate(template_id: template_id)
|
35
35
|
end
|
36
36
|
|
37
|
+
def subscribe_message_send(message)
|
38
|
+
post 'message/subscribe/send', message.to_json
|
39
|
+
end
|
40
|
+
|
37
41
|
def jscode2session(code)
|
38
42
|
params = {
|
39
43
|
appid: access_token.appid,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wechat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Skinnyworm
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
2Gz/SZ1dgCkJpJU45GNrhatKx3kyg8eC5IHekNrEvJNJqPl0VdRIs/GtUkQyk+np
|
36
36
|
3kTPkfLMsAZznXo3bzMe0V5TB4+a7pFEK1nN/htWrOVkIi/3
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2019-
|
38
|
+
date: 2019-11-15 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: activesupport
|
metadata.gz.sig
CHANGED
Binary file
|