Skip to content

Commit

Permalink
添加判断LiveSendDanmaku是否发送了屏蔽词 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
863056768 authored Apr 30, 2023
1 parent 6a8cb68 commit 2b51a7f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions bili_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,6 @@ func (b *BiliClient) FavGetRes(mlid int64) ([]*FavRes, error) {

// FavGetResDetail 获取收藏夹内容详细内容,带过滤功能
//
//
// tid 分区id,用于筛选,传入0代表所有分区
//
// keyword 关键词筛选 可留空
Expand Down Expand Up @@ -2696,7 +2695,7 @@ func (b *BiliClient) DynaGetDrafts() (*DynaGetDraft, error) {
//
// bubble: 气泡弹幕?默认0
func (b *BiliClient) LiveSendDanmaku(roomID int64, color int64, fontsize int, mode int, msg string, bubble int) error {
_, err := b.RawParse(
resp, err := b.RawParse(
BiliLiveURL,
"msg/send",
"POST",
Expand All @@ -2710,7 +2709,16 @@ func (b *BiliClient) LiveSendDanmaku(roomID int64, color int64, fontsize int, mo
"rnd": strconv.FormatInt(time.Now().Unix(), 10),
},
)
return err
if err != nil {
return err
}
if resp.Message == "f" {
return errors.New("(0) 弹幕包含屏蔽词")
}
if resp.Message == "k" {
return errors.New("(0) 弹幕包含直播间指定屏蔽词")
}
return nil
}
func (b *BiliClient) UserGetInfo(mid int64) (*UserInfo, error) {
resp, err := b.RawParse(
Expand Down

0 comments on commit 2b51a7f

Please sign in to comment.