mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
feat enable_self_message config.
This commit is contained in:
parent
93da16897a
commit
a90af94eda
@ -61,7 +61,9 @@ func NewQQBot(cli *client.QQClient, conf *global.JSONConfig) *CQBot {
|
||||
}
|
||||
bot.Client.OnPrivateMessage(bot.privateMessageEvent)
|
||||
bot.Client.OnGroupMessage(bot.groupMessageEvent)
|
||||
if conf.EnableSelfMessage {
|
||||
bot.Client.OnSelfGroupMessage(bot.groupMessageEvent)
|
||||
}
|
||||
bot.Client.OnTempMessage(bot.tempMessageEvent)
|
||||
bot.Client.OnGroupMuted(bot.groupMutedEvent)
|
||||
bot.Client.OnGroupMessageRecalled(bot.groupRecallEvent)
|
||||
|
@ -21,6 +21,7 @@ go-cqhttp 支持导入CQHTTP的配置文件, 具体步骤为:
|
||||
"encrypt_password": false,
|
||||
"password_encrypted": "",
|
||||
"enable_db": true,
|
||||
"enable_self_message": false,
|
||||
"access_token": "",
|
||||
"relogin": {
|
||||
"enabled": true,
|
||||
@ -42,7 +43,9 @@ go-cqhttp 支持导入CQHTTP的配置文件, 具体步骤为:
|
||||
"host": "0.0.0.0",
|
||||
"port": 5700,
|
||||
"timeout": 5,
|
||||
"post_urls": {"url:port": "secret"}
|
||||
"post_urls": {
|
||||
"url:port": "secret"
|
||||
}
|
||||
},
|
||||
"ws_config": {
|
||||
"enabled": true,
|
||||
@ -68,6 +71,7 @@ go-cqhttp 支持导入CQHTTP的配置文件, 具体步骤为:
|
||||
| encrypt_password | bool | 是否对密码进行加密. |
|
||||
| password_encrypted | string | 加密后的密码(请勿修改) |
|
||||
| enable_db | bool | 是否开启内置数据库, 关闭后将无法使用 **回复/撤回** 等上下文相关接口 |
|
||||
| enable_self_message | bool | 是否启用 `message_sent` 事件 |
|
||||
| access_token | string | 同CQHTTP的 `access_token` 用于身份验证 |
|
||||
| relogin | bool | 是否自动重新登录 |
|
||||
| relogin_delay | int | 重登录延时(秒) |
|
||||
@ -127,6 +131,7 @@ go-cqhttp 支持导入CQHTTP的配置文件, 具体步骤为:
|
||||
将文件 `address.txt` 创建到 `go-cqhttp` 工作目录, 并键入 `IP:PORT` 以换行符为分割即可.
|
||||
|
||||
示例:
|
||||
|
||||
````
|
||||
1.1.1.1:53
|
||||
1.1.2.2:8899
|
||||
|
@ -145,6 +145,7 @@ type JSONConfig struct {
|
||||
EncryptPassword bool `json:"encrypt_password"`
|
||||
PasswordEncrypted string `json:"password_encrypted"`
|
||||
EnableDB bool `json:"enable_db"`
|
||||
EnableSelfMessage bool `json:"enable_self_message"`
|
||||
AccessToken string `json:"access_token"`
|
||||
ReLogin struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user