支持qq推送与交互
This commit is contained in:
parent
ffff6a9992
commit
865f9f9322
|
@ -54,6 +54,7 @@ type Config struct {
|
|||
PostAddr string `json:"post_addr" mapstructure:"post_addr"`
|
||||
SuperUser int64 `json:"super_user" mapstructure:"super_user"`
|
||||
WhiteList []int64 `json:"white_list" mapstructure:"white_list"`
|
||||
AccessToken string `json:"access_token" mapstructure:"access_token"`
|
||||
}
|
||||
Cron string `json:"cron" yaml:"cron" mapstructure:"cron"`
|
||||
CronRandomWait int `json:"cron_random_wait" yaml:"cron_random_wait" mapstructure:"cron_random_wait"`
|
||||
|
|
|
@ -289,7 +289,7 @@ func (e *Event) sendGroupMsg(groupId int64, message any) int {
|
|||
},
|
||||
}
|
||||
}
|
||||
response, err := utils.GetClient().R().SetBodyJsonMarshal(map[string]any{
|
||||
response, err := utils.GetClient().R().SetHeader("Authorization", conf.GetConfig().QQ.AccessToken).SetBodyJsonMarshal(map[string]any{
|
||||
"action": "send_group_msg",
|
||||
"params": map[string]any{
|
||||
"group_id": groupId,
|
||||
|
@ -319,7 +319,7 @@ func (e *Event) sendPrivateMsg(userId int64, message any) int {
|
|||
},
|
||||
}
|
||||
}
|
||||
response, err := utils.GetClient().R().SetBodyJsonMarshal(map[string]any{
|
||||
response, err := utils.GetClient().R().SetHeader("Authorization", conf.GetConfig().QQ.AccessToken).SetBodyJsonMarshal(map[string]any{
|
||||
"action": "send_private_msg",
|
||||
"params": map[string]any{
|
||||
"user_id": userId,
|
||||
|
|
Loading…
Reference in New Issue