mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
update dep
This commit is contained in:
parent
414f067431
commit
91facb54ce
@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
"github.com/Mrs4s/MiraiGo/client"
|
"github.com/Mrs4s/MiraiGo/client"
|
||||||
"github.com/Mrs4s/MiraiGo/utils"
|
"github.com/Mrs4s/MiraiGo/utils"
|
||||||
"github.com/Mrs4s/MiraiGo/warpper"
|
"github.com/Mrs4s/MiraiGo/wrapper"
|
||||||
"github.com/mattn/go-colorable"
|
"github.com/mattn/go-colorable"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
@ -28,7 +28,7 @@ import (
|
|||||||
var console = bufio.NewReader(os.Stdin)
|
var console = bufio.NewReader(os.Stdin)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
warpper.DandelionEnergy = energy
|
wrapper.DandelionEnergy = energy
|
||||||
}
|
}
|
||||||
|
|
||||||
func readLine() (str string) {
|
func readLine() (str string) {
|
||||||
@ -273,22 +273,22 @@ func fetchCaptcha(id string) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func energy(id string, salt []byte) []byte {
|
func energy(uin uint64, id string, salt []byte) ([]byte, error) {
|
||||||
// temporary solution
|
// temporary solution
|
||||||
response, err := download.Request{
|
response, err := download.Request{
|
||||||
Method: http.MethodPost,
|
Method: http.MethodPost,
|
||||||
URL: "https://captcha.go-cqhttp.org/sdk/dandelion/energy",
|
URL: "https://captcha.go-cqhttp.org/sdk/dandelion/energy",
|
||||||
Header: map[string]string{"Content-Type": "application/x-www-form-urlencoded"},
|
Header: map[string]string{"Content-Type": "application/x-www-form-urlencoded"},
|
||||||
Body: bytes.NewReader([]byte(fmt.Sprintf("id=%s&salt=%s", id, hex.EncodeToString(salt)))),
|
Body: bytes.NewReader([]byte(fmt.Sprintf("uin=%v&id=%s&salt=%s", uin, id, hex.EncodeToString(salt)))),
|
||||||
}.Bytes()
|
}.Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("获取T544时出现问题: %v", err)
|
log.Errorf("获取T544时出现问题: %v", err)
|
||||||
return nil
|
return nil, err
|
||||||
}
|
}
|
||||||
sign, err := hex.DecodeString(gjson.GetBytes(response, "result").String())
|
sign, err := hex.DecodeString(gjson.GetBytes(response, "result").String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("获取T544时出现问题: %v", err)
|
log.Errorf("获取T544时出现问题: %v", err)
|
||||||
return nil
|
return nil, err
|
||||||
}
|
}
|
||||||
return sign
|
return sign, nil
|
||||||
}
|
}
|
||||||
|
2
go.mod
2
go.mod
@ -5,7 +5,7 @@ go 1.20
|
|||||||
require (
|
require (
|
||||||
github.com/FloatTech/sqlite v1.5.7
|
github.com/FloatTech/sqlite v1.5.7
|
||||||
github.com/Microsoft/go-winio v0.6.0
|
github.com/Microsoft/go-winio v0.6.0
|
||||||
github.com/Mrs4s/MiraiGo v0.0.0-20230305102225-a42218b851d8
|
github.com/Mrs4s/MiraiGo v0.0.0-20230310170800-80b6b2843637
|
||||||
github.com/RomiChan/syncx v0.0.0-20221202055724-5f842c53020e
|
github.com/RomiChan/syncx v0.0.0-20221202055724-5f842c53020e
|
||||||
github.com/RomiChan/websocket v1.4.3-0.20220123145318-307a86b127bc
|
github.com/RomiChan/websocket v1.4.3-0.20220123145318-307a86b127bc
|
||||||
github.com/fumiama/go-base16384 v1.6.1
|
github.com/fumiama/go-base16384 v1.6.1
|
||||||
|
4
go.sum
4
go.sum
@ -4,8 +4,8 @@ github.com/FloatTech/ttl v0.0.0-20220715042055-15612be72f5b h1:tvciXWq2nuvTbFeJG
|
|||||||
github.com/FloatTech/ttl v0.0.0-20220715042055-15612be72f5b/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs=
|
github.com/FloatTech/ttl v0.0.0-20220715042055-15612be72f5b/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs=
|
||||||
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
|
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
|
||||||
github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE=
|
github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE=
|
||||||
github.com/Mrs4s/MiraiGo v0.0.0-20230305102225-a42218b851d8 h1:0RMPpAHY5W5rdDVRtrc5nWtDCnmrR5E9L6wi9y1uhAc=
|
github.com/Mrs4s/MiraiGo v0.0.0-20230310170800-80b6b2843637 h1:6Gmc1Y4LLhLFaniN6QbYelXOANOuXwlknmT6+ao7BZw=
|
||||||
github.com/Mrs4s/MiraiGo v0.0.0-20230305102225-a42218b851d8/go.mod h1:mU3fBFU+7eO0kaGes7YRKtzIDtwIU84nSSwTV7NK2b0=
|
github.com/Mrs4s/MiraiGo v0.0.0-20230310170800-80b6b2843637/go.mod h1:mU3fBFU+7eO0kaGes7YRKtzIDtwIU84nSSwTV7NK2b0=
|
||||||
github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d h1:/Xuj3fIiMY2ls1TwvPKmaqQrtJsPY+c9s+0lOScVHd8=
|
github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d h1:/Xuj3fIiMY2ls1TwvPKmaqQrtJsPY+c9s+0lOScVHd8=
|
||||||
github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d/go.mod h1:2Ie+hdBFQpQFDHfeklgxoFmQRCE7O+KwFpISeXq7OwA=
|
github.com/RomiChan/protobuf v0.1.1-0.20230204044148-2ed269a2e54d/go.mod h1:2Ie+hdBFQpQFDHfeklgxoFmQRCE7O+KwFpISeXq7OwA=
|
||||||
github.com/RomiChan/syncx v0.0.0-20221202055724-5f842c53020e h1:wR3MXQ3VbUlPKOOUwLOYgh/QaJThBTYtsl673O3lqSA=
|
github.com/RomiChan/syncx v0.0.0-20221202055724-5f842c53020e h1:wR3MXQ3VbUlPKOOUwLOYgh/QaJThBTYtsl673O3lqSA=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user