Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooling0602 authored May 31, 2024
1 parent c086425 commit 38a7b90
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,8 @@
| allow_all_rooms_msg | 是否允许来自所有房间的消息,若开启,则来自机器人账号所加入的房间的消息都会被转发到游戏中,并注明房间的显示名称,否则只转发已设置的房间的消息 |
| use_token | 是否使用Token,默认启用,下次重启服务器时会加载部分之前收到的消息(发生在服务器启动完毕时,如果玩家登录过快,可能会在线上游戏内看到),并使用之前的会话继续转发来自Matrix的消息到游戏中;如果不想加载历史消息可以关闭,但每次重启服务器都会产生新的登录会话记录 |

## 接口(API)
插件提供了一个协程函数`sendMsg()`供其他开发者调用以实现向Matrix群组发送自定义内容,其回调参数为`message`下面是代码参考:
```
import asyncio
import ...
from mcdreforged.api.all import *
from matrix_sync.reporter import sendMsg
from ... import ...
def main():
pass
asyncio.run(sendMsg(message))
```
`message`替换成你想要发送的自定义内容即可。

## 注意
- 插件不支持热重载,为确保功能正常,如果尝试重载或者插件,将导致服务器和MCDR直接关闭。
- 首次加载插件的时候,插件将自动初始化配置并卸载自己。你需要正确修改默认的配置文件,然后重启服务器或着重载插件以正常使用。
- 不打算支持加密信息(EE2E),有需要可以二次开发修改插件。
- 多语言目前只支持中文(简体)和英语(用谷歌从中文翻译),任何人都可以联系我帮助翻译。

0 comments on commit 38a7b90

Please sign in to comment.