From 2b51a7f5ef332f20dbb0b04107ee6c1d5dc21f9d Mon Sep 17 00:00:00 2001 From: 863056768 <51009484+863056768@users.noreply.github.com> Date: Sun, 30 Apr 2023 19:14:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E6=96=ADLiveSendDan?= =?UTF-8?q?maku=E6=98=AF=E5=90=A6=E5=8F=91=E9=80=81=E4=BA=86=E5=B1=8F?= =?UTF-8?q?=E8=94=BD=E8=AF=8D=20(#8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bili_client.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bili_client.go b/bili_client.go index b03f837..ea6644d 100644 --- a/bili_client.go +++ b/bili_client.go @@ -974,7 +974,6 @@ func (b *BiliClient) FavGetRes(mlid int64) ([]*FavRes, error) { // FavGetResDetail 获取收藏夹内容详细内容,带过滤功能 // -// // tid 分区id,用于筛选,传入0代表所有分区 // // keyword 关键词筛选 可留空 @@ -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", @@ -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(