mirror of
https://github.com/AynaLivePlayer/blivedm-go.git
synced 2025-12-06 19:32:49 +08:00
🎨 byte-string convert
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
package message
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"github.com/Akegarasu/blivedm-go/utils"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
@@ -72,9 +71,9 @@ type SuperChat struct {
|
||||
}
|
||||
|
||||
func (s *SuperChat) Parse(data []byte) {
|
||||
sb := bytes.NewBuffer(data).String()
|
||||
sb := utils.BytesToString(data)
|
||||
sd := gjson.Get(sb, "data").String()
|
||||
err := json.Unmarshal([]byte(sd), s)
|
||||
err := utils.UnmarshalString(sd, s)
|
||||
if err != nil {
|
||||
log.Error("parse superchat failed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user