Skip to content

Commit

Permalink
hint修复
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaodice committed Dec 30, 2024
1 parent ce201f5 commit d07f48e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions cmd/gocq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ func LoginInteract() {
}
log.Warnf("Bot已离线: %v", e.Message)
if !e.Reconnection {
log.Infof("当前登录已挂起,请按下回车重新登录[Enter 继续]")
readLine()
log.Infof("当前登录已挂起,请按下回车重新登录 [Enter 继续/300s后自动重试]")
readLineTimeout(time.Second * time.Duration(300))
} else {
time.Sleep(time.Second * time.Duration(base.Reconnect.Delay))
}
Expand Down
7 changes: 4 additions & 3 deletions cmd/gocq/qsign.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ func requestSignServer(url string, data map[string]string) (string, []byte, erro
if !strings.HasPrefix(url, signServer.URL) {
url = strings.TrimSuffix(signServer.URL, "/") + "/" + strings.TrimPrefix(url, "/")
}
if headers == nil {
headers = map[string]string{}
}
/*
if headers == nil {
headers = map[string]string{}
}*/
auth := signServer.Authorization
if auth != "-" && auth != "" {
headers["Authorization"] = auth
Expand Down
16 changes: 8 additions & 8 deletions coolq/cqcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -900,21 +900,21 @@ func (bot *CQBot) makeImageOrVideoElem(elem msg.Element, video bool, sourceType
_ = os.Remove(cacheFile)
}
{
var requestUrl = f
if strings.HasPrefix(requestUrl, "https://multimedia.nt.qq.com.cn/") {
var requestURL = f
if strings.HasPrefix(requestURL, "https://multimedia.nt.qq.com.cn/") {
rKey, err := bot.Client.GetRKey()
if err != nil {
log.Warnf("Cannot Fetch RKey for download media.")
return nil, err
}

if sourceType == message.SourceGroup {
requestURL = f + (*rKey)[message.BusinessGroupImage].RKey
} else {
if sourceType == message.SourceGroup {
requestUrl = f + (*rKey)[message.BusinessGroupImage].RKey
} else {
requestUrl = f + (*rKey)[message.BusinessFriendImage].RKey
}
requestURL = f + (*rKey)[message.BusinessFriendImage].RKey
}
}
r := download.Request{URL: requestUrl, Limit: maxSize}
r := download.Request{URL: requestURL, Limit: maxSize}
if err := r.WriteToFileMultiThreading(cacheFile, thread); err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion coolq/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ func (bot *CQBot) guildMessageReactionsUpdatedEvent(c *client.QQClient, e *clien
if len(e.CurrentReactions) == 0 {
str += "无任何表情"

Check failure on line 226 in coolq/event.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to str (ineffassign)
}
log.Infof(str)
bot.dispatchEvent("notice/message_reactions_updated", global.MSG{
"guild_id": fU64(e.GuildId),
"channel_id": fU64(e.ChannelId),
Expand Down

0 comments on commit d07f48e

Please sign in to comment.