fix(matrix): specify correct device_id
Signed-off-by: xtex <xtexchooser@duck.com>
This commit is contained in:
parent
124e3a4c57
commit
4332d54dd7
3 changed files with 7 additions and 7 deletions
10
DEPLOY.md
10
DEPLOY.md
|
@ -310,7 +310,9 @@ pip install -r requirements.txt
|
||||||
|
|
||||||
`matrix_homeserver =` - 填写您使用的 Matrix server URL(只包括协议与主机,最后无需添加`/`)。
|
`matrix_homeserver =` - 填写您使用的 Matrix server URL(只包括协议与主机,最后无需添加`/`)。
|
||||||
|
|
||||||
`matrix_user =` - 填写机器人的[用户 ID](https://spec.matrix.org/v1.7/appendices/#user-identifiers)(包括`@`与`:`)。
|
`matrix_user =` - 填写机器人的[完全限定用户 ID](https://spec.matrix.org/v1.7/appendices/#user-identifiers)(包括`@`与`:`)。
|
||||||
|
|
||||||
|
`matrix_device_id =` - 填写机器人的设备 ID(即 Element 的会话 ID)
|
||||||
|
|
||||||
`matrix_token =` - 填写机器人任意设备的 Access Token。
|
`matrix_token =` - 填写机器人任意设备的 Access Token。
|
||||||
|
|
||||||
|
@ -326,11 +328,7 @@ pip install -r requirements.txt
|
||||||
curl -XPOST -d '{"type":"m.login.password", "user":"<user>", "password":"<password>"}' "https://<homeserver>/_matrix/client/r0/login"
|
curl -XPOST -d '{"type":"m.login.password", "user":"<user>", "password":"<password>"}' "https://<homeserver>/_matrix/client/r0/login"
|
||||||
```
|
```
|
||||||
|
|
||||||
##### E2E加密
|
目前,由于 libolm 在一些情况下需要手动安装,机器人没有端对端加密(e2ee)支持。
|
||||||
|
|
||||||
目前,由于 libolm 在一些情况下需要手动配置,机器人默认没有启用端对端加密(e2ee)支持。
|
|
||||||
|
|
||||||
`matrix_megolm_backup_passphrase =` - (可选)填写机器人的 megolm 备份密码短语,建议使用随机的长密码,不填写则不会导出 megolm 备份。
|
|
||||||
|
|
||||||
### 配置其他功能
|
### 配置其他功能
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ from core.logger import Logger
|
||||||
|
|
||||||
homeserver: str = Config('matrix_homeserver')
|
homeserver: str = Config('matrix_homeserver')
|
||||||
user: str = Config('matrix_user')
|
user: str = Config('matrix_user')
|
||||||
|
device_id: str = Config('matrix_device_id')
|
||||||
token: str = Config('matrix_token')
|
token: str = Config('matrix_token')
|
||||||
megolm_backup_passphrase: str = Config('matrix_megolm_backup_passphrase')
|
megolm_backup_passphrase: str = Config('matrix_megolm_backup_passphrase')
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ if homeserver and user and token:
|
||||||
homeserver_host = urllib3.util.parse_url(homeserver).host
|
homeserver_host = urllib3.util.parse_url(homeserver).host
|
||||||
bot: AsyncClient = AsyncClient(homeserver,
|
bot: AsyncClient = AsyncClient(homeserver,
|
||||||
user,
|
user,
|
||||||
device_id='AkariBot',
|
device_id=device_id,
|
||||||
store_path=store_path_nio,
|
store_path=store_path_nio,
|
||||||
config=AsyncClientConfig(store_sync_tokens=True))
|
config=AsyncClientConfig(store_sync_tokens=True))
|
||||||
bot.access_token = token
|
bot.access_token = token
|
||||||
|
|
|
@ -13,6 +13,7 @@ dc_token =
|
||||||
tg_token =
|
tg_token =
|
||||||
matrix_homeserver =
|
matrix_homeserver =
|
||||||
matrix_user =
|
matrix_user =
|
||||||
|
matrix_device_id =
|
||||||
matrix_token =
|
matrix_token =
|
||||||
matrix_megolm_backup_passphrase =
|
matrix_megolm_backup_passphrase =
|
||||||
kook_token =
|
kook_token =
|
||||||
|
|
Reference in a new issue