mirror of
https://github.com/AynaLivePlayer/blivedm-go.git
synced 2025-12-06 11:22:50 +08:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -26,6 +26,7 @@ type (
|
||||
|
||||
Extra struct {
|
||||
SendFromMe bool `json:"send_from_me"`
|
||||
MasterPlayerHidden bool `json:"master_player_hidden"`
|
||||
Mode int `json:"mode"`
|
||||
Color int `json:"color"`
|
||||
DmType int `json:"dm_type"`
|
||||
@@ -35,10 +36,32 @@ type (
|
||||
Content string `json:"content"`
|
||||
UserHash string `json:"user_hash"`
|
||||
EmoticonUnique string `json:"emoticon_unique"`
|
||||
BulgeDisplay int `json:"bulge_display"`
|
||||
RecommendScore int `json:"recommend_score"`
|
||||
MainStateDmColor string `json:"main_state_dm_color"`
|
||||
ObjectiveStateDmColor string `json:"objective_state_dm_color"`
|
||||
Direction int `json:"direction"`
|
||||
PkDirection int `json:"pk_direction"`
|
||||
QuartetDirection int `json:"quartet_direction"`
|
||||
AnniversaryCrowd int `json:"anniversary_crowd"`
|
||||
YeahSpaceType string `json:"yeah_space_type"`
|
||||
YeahSpaceURL string `json:"yeah_space_url"`
|
||||
JumpToURL string `json:"jump_to_url"`
|
||||
SpaceType string `json:"space_type"`
|
||||
SpaceUrl string `json:"space_url"`
|
||||
SpaceURL string `json:"space_url"`
|
||||
// Animation any `json:"animation"`
|
||||
// Emots any `json:"emots"`
|
||||
IsAudited bool `json:"is_audited"`
|
||||
IDStr string `json:"id_str"`
|
||||
// Icon any `json:"icon"`
|
||||
ShowReply bool `json:"show_reply"`
|
||||
ReplyMid int `json:"reply_mid"`
|
||||
ReplyUname string `json:"reply_uname"`
|
||||
ReplyUnameColor string `json:"reply_uname_color"`
|
||||
ReplyIsMystery bool `json:"reply_is_mystery"`
|
||||
ReplyTypeEnum int `json:"reply_type_enum"`
|
||||
HitCombo int `json:"hit_combo"`
|
||||
EsportsJumpURL string `json:"esports_jump_url"`
|
||||
}
|
||||
Emoticon struct {
|
||||
BulgeDisplay int `json:"bulge_display"`
|
||||
|
||||
@@ -6,16 +6,17 @@ import (
|
||||
)
|
||||
|
||||
func StringToBytes(s string) []byte {
|
||||
return *(*[]byte)(unsafe.Pointer(
|
||||
&struct {
|
||||
string
|
||||
Cap int
|
||||
}{s, len(s)},
|
||||
))
|
||||
if len(s) == 0 {
|
||||
return nil
|
||||
}
|
||||
return unsafe.Slice(unsafe.StringData(s), len(s))
|
||||
}
|
||||
|
||||
func BytesToString(b []byte) string {
|
||||
return *(*string)(unsafe.Pointer(&b))
|
||||
if len(b) == 0 {
|
||||
return ""
|
||||
}
|
||||
return unsafe.String(unsafe.SliceData(b), len(b))
|
||||
}
|
||||
|
||||
func B64Decode(s string) ([]byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user