Skip to content

Commit de3412c

Browse files
committed
move encrypt doc to start
1 parent 465ad72 commit de3412c

File tree

3 files changed

+14
-26
lines changed

3 files changed

+14
-26
lines changed

docs/encrypt.rst

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ WeRoBot 是一个微信公众号开发框架。
1616
replies
1717
session
1818
config
19-
encrypt
2019
contrib
2120
error-page
2221
client

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)