diff --git a/conf/config.go b/conf/config.go index 1c00bcc..ae3c171 100644 --- a/conf/config.go +++ b/conf/config.go @@ -50,10 +50,11 @@ type Config struct { CommonUser map[string]string `json:"common_user" yaml:"common_user" mapstructure:"common_user"` } `json:"web" yaml:"web" mapstructure:"web"` QQ struct { - Enable bool `json:"enable" mapstructure:"enable"` - PostAddr string `json:"post_addr" mapstructure:"post_addr"` - SuperUser int64 `json:"super_user" mapstructure:"super_user"` - WhiteList []int64 `json:"white_list" mapstructure:"white_list"` + Enable bool `json:"enable" mapstructure:"enable"` + 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"` diff --git a/push/qq.go b/push/qq.go index 47a3106..326781e 100644 --- a/push/qq.go +++ b/push/qq.go @@ -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,