Skip to content

Commit 3bc4d05

Browse files
committed
Update to v2.3.2, improved matrix_sync.reporter.sender()
Signed-off-by: Mooling0602 <clemooling@outlook.com>
1 parent 9196e9e commit 3bc4d05

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

docs.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
- 中文
2+
- English (Unsupported yet, please use translate tools.)
3+
4+
# MatrixSync-MCDR 文档
5+
这里是MCDReforged插件MatrixSync的文档。
6+
7+
插件配置部分仍保留在README。
8+
9+
## 接口(API)
10+
这里介绍插件提供的内部接口。
11+
12+
### 新版接口(v2.3.2)
13+
2.3版本以后,插件开始重构已有的消息上报器(MC -> Matrix)接口,至2.3.2完善。
14+
15+
简单用法:
16+
```python
17+
import ...
18+
from matrix_sync.reporter import sender
19+
20+
def main():
21+
sender(message)
22+
```
23+
目前仍无法获取发送结果,但如果主插件在加载时没有成功初始化客户端,你可以通过以下方式获取到相关报错:
24+
```python
25+
import ...
26+
from matrix_sync.reporter import sender
27+
28+
def main():
29+
response = sender(message)
30+
if response is not None:
31+
print(response)
32+
```
33+
> 在MCDR中,常用`server.logger.info``psi.logger.info`代替`print`,以进行更标准化的日志格式输出。
34+
35+
### 旧版接口(v2.3-)
36+
旧版接口含有较大缺陷,且已不具备实用的应用场景,但仍然可用,后续有空再补充。

docs_en_US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
to do.

0 commit comments

Comments
 (0)