Skip to content

Commit 6c12cab

Browse files
authored
Merge pull request #171 from whtsky/encryption-doc
Add doc for encrypt
2 parents 7bfa1c0 + de3412c commit 6c12cab

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/start.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,18 @@ Hello World
1616

1717
robot.run()
1818

19+
消息加密
20+
--------------
21+
22+
WeRoBot 支持对消息的加密,即微信公众号的安全模式。
23+
为 WeRoBot 开启消息加密功能,首先需要安装 ``cryptography`` ::
24+
25+
pip install cryptography
26+
27+
之后需要在微信公众平台的基本配置中将消息加解密方式选择为安全模式,随机生成 `EncodingAESKey`,并且把它传给 WeRoBot 或者 WeRoBot 实例的 config 或者创建相对应的 Config 类 ::
28+
29+
from werobot import WeRoBot
30+
robot = WeRoBot(token='2333',
31+
encoding_aes_key='your_encoding_aes_key',
32+
app_id='your_app_id')
1933

0 commit comments

Comments
 (0)