1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-07 12:43:31 +08:00

try to fix group image upload failed. #65

This commit is contained in:
Mrs4s 2020-08-14 08:28:37 +08:00
parent edf6180e1c
commit b290a0a596
2 changed files with 7 additions and 7 deletions

View File

@ -94,7 +94,7 @@ func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int
var newElem []message.IMessageElement
for _, elem := range m.Elements {
if i, ok := elem.(*message.ImageElement); ok {
gm, err := bot.Client.UploadGroupImage(groupId, i.Data)
gm, err := bot.Client.UploadGroupImage(114514, i.Data)
if err != nil {
log.Warnf("警告: 群 %v 消息图片上传失败: %v", groupId, err)
continue

12
main.go
View File

@ -198,14 +198,14 @@ func main() {
global.Check(cli.ReloadGroupList())
log.Infof("共加载 %v 个群.", len(cli.GroupList))
b := coolq.NewQQBot(cli, conf)
if conf.PostMessageFormat != "string" && conf.PostMessageFormat != "array" {
log.Warnf("post_message_format 配置错误, 将自动使用 string")
coolq.SetMessageFormat("string")
} else {
coolq.SetMessageFormat(conf.PostMessageFormat)
}
if conf.HttpConfig != nil && conf.HttpConfig.Enabled {
server.HttpServer.Run(fmt.Sprintf("%s:%d", conf.HttpConfig.Host, conf.HttpConfig.Port), conf.AccessToken, b)
if conf.PostMessageFormat != "string" && conf.PostMessageFormat != "array" {
log.Warnf("http_config.post_message_format 配置错误, 将自动使用 string")
coolq.SetMessageFormat("string")
} else {
coolq.SetMessageFormat(conf.PostMessageFormat)
}
for k, v := range conf.HttpConfig.PostUrls {
server.NewHttpClient().Run(k, v, conf.HttpConfig.Timeout, b)
}