Skip to content

Commit

Permalink
hint修复2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaodice committed Dec 30, 2024
1 parent d07f48e commit bebb369
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
19 changes: 0 additions & 19 deletions cmd/gocq/qsign.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package gocq

import (
"bytes"
"crypto/hmac"
"crypto/md5"
"crypto/sha256"
"encoding/hex"
"fmt"
"net/http"
Expand Down Expand Up @@ -121,23 +119,6 @@ func asyncCheckServer(servers []config.SignServer) *config.SignServer {
return ss.get()
}

func generateSignature(data map[string]string, secretKey string) string {
// Convert map to POST body format
var body bytes.Buffer
for key, value := range data {
body.WriteString(fmt.Sprintf("%v=%v&", key, value))
}
bodyString := body.String()
bodyString = bodyString[:len(bodyString)-1] // Remove the last '&'

// Generate the HMAC-SHA256 signature
h := hmac.New(sha256.New, []byte(secretKey))
h.Write([]byte(bodyString))
signature := hex.EncodeToString(h.Sum(nil))

return signature
}

/*
请求签名服务器
Expand Down
3 changes: 3 additions & 0 deletions coolq/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ func (bot *CQBot) guildMessageReactionsUpdatedEvent(c *client.QQClient, e *clien
if len(e.CurrentReactions) == 0 {
str += "无任何表情"
}

log.Debug(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 bebb369

Please sign in to comment.