Skip to main content

LiveClient

Struct LiveClient 

Source
pub struct LiveClient<'a> { /* private fields */ }
Expand description

Live API client.

Implementations§

Source§

impl<'a> LiveClient<'a>

Source

pub async fn area_list(&self) -> BpiResult<Vec<LiveParentArea>>

Fetches all live area categories.

Source

pub async fn room_info(&self, room_id: i64) -> BpiResult<RoomInfoData>

Fetches public room information by real room ID.

Source

pub async fn stream( &self, cid: i64, platform: Option<&str>, quality: Option<i32>, qn: Option<i32>, ) -> BpiResult<LiveStreamData>

Fetches live stream URLs by real room ID.

Source

pub async fn recommend(&self) -> BpiResult<RecommendData>

Fetches the web homepage live recommendation list.

Source

pub async fn version(&self) -> BpiResult<PcLiveVersionData>

Fetches the current PC live client version metadata.

Source

pub async fn gift_types(&self) -> BpiResult<Vec<GiftTypeItem>>

Fetches the authenticated live gift type list.

Source

pub async fn room_gift_list( &self, room_id: i64, area_parent_id: Option<i32>, area_id: Option<i32>, ) -> BpiResult<RoomGiftData>

Fetches the gift panel for a live room.

Source

pub async fn blind_gift_info(&self, gift_id: i64) -> BpiResult<BlindGiftData>

Fetches blind gift probability details.

Source

pub async fn danmu_info( &self, room_id: u64, info_type: u8, ) -> BpiResult<LiveDanmuInfoData>

Fetches live WebSocket danmu token and host information.

Source

pub async fn emoticons( &self, room_id: i64, platform: &str, ) -> BpiResult<EmoticonData>

Fetches live room emoticon packages.

Source

pub async fn lottery_info(&self, room_id: i64) -> BpiResult<LotteryInfoData>

Fetches live room lottery information.

Source

pub async fn my_medals( &self, page: i32, page_size: i32, ) -> BpiResult<MyMedalsData>

Fetches the current account’s live fan medals.

Source

pub async fn follow_up_list( &self, page: Option<i32>, page_size: Option<i32>, ignore_record: Option<i32>, hit_ab: Option<bool>, ) -> BpiResult<FollowUpLiveData>

Fetches followed streamers and their live status.

Source

pub async fn follow_up_web_list( &self, hit_ab: Option<bool>, ) -> BpiResult<LiveWebListData>

Fetches followed streamers that are currently live.

Source

pub async fn replay_list( &self, page: Option<i32>, page_size: Option<i32>, ) -> BpiResult<ReplayListData>

Fetches the current account’s live replay list.

Source

pub async fn guard_list( &self, room_id: i64, ruid: i64, page: Option<i32>, page_size: Option<i32>, typ: Option<i32>, ) -> BpiResult<GuardListData>

Fetches live guard members for a room.

Source

pub async fn silent_users( &self, params: LiveSilentUserListParams, ) -> BpiResult<SilentUserListData>

Fetches silent users for a live room.

Source

pub async fn banned_users( &self, params: LiveBannedUserListParams, ) -> BpiResult<BannedUserListData>

Fetches banned users for a live anchor.

Source

pub async fn shield_keywords( &self, params: LiveShieldKeywordListParams, ) -> BpiResult<ShieldKeywordListData>

Fetches shield keywords for a live room.

Source

pub async fn web_heart_beat( &self, params: LiveWebHeartBeatParams, ) -> BpiResult<HeartBeatData>

Sends a web heartbeat for live telemetry.

Source§

impl<'a> LiveClient<'a>

Source

pub async fn live_send_danmu( &self, room_id: u64, message: &str, color: Option<u32>, font_size: Option<u32>, ) -> BpiResult<SendDanmuData>

发送直播间弹幕

§参数
  • room_id - 直播间 ID
  • message - 弹幕内容
  • color - 十进制颜色值,默认 16777215 (白色)
  • font_size - 字体大小,默认 25
Source§

impl<'a> LiveClient<'a>

Source

pub async fn live_create_room(&self) -> BpiResult<CreateRoomData>

开通直播间

Source

pub async fn live_update_room_info( &self, room_id: u64, title: Option<&str>, area_id: Option<u64>, add_tag: Option<&str>, del_tag: Option<&str>, ) -> BpiResult<UpdateRoomData>

更新直播间信息

§参数
  • room_id - 直播间 ID
  • title - 标题,可选
  • area_id - 分区 ID,可选
  • add_tag - 要添加的标签,可选
  • del_tag - 要删除的标签,可选
Source

pub async fn live_stop( &self, room_id: u64, platform: &str, ) -> BpiResult<StopLiveData>

关闭直播

§参数
  • room_id - 直播间 ID
  • platform - 直播平台,如 “pc_link”
Source

pub async fn live_update_pre_live_info( &self, title: Option<&str>, cover: Option<&str>, ) -> BpiResult<UpdatePreLiveInfoData>

预更新直播间信息

§参数
  • title - 标题,可选
  • cover - 封面 URL,可选
Source

pub async fn live_update_room_news( &self, room_id: u64, uid: u64, content: &str, ) -> BpiResult<Value>

更新直播间公告

§参数
  • room_id - 直播间 ID
  • uid - 用户ID
  • content - 公告内容
Source§

impl<'a> LiveClient<'a>

Source

pub async fn live_add_silent_user( &self, room_id: i64, tuid: i64, hour: i32, msg: Option<String>, ) -> BpiResult<Option<Value>>

禁言观众 tuid: 用户uid hour: -1永久 0本场直播 msg: 禁言理由,一般为禁言的弹幕,选填

Source

pub async fn live_del_block_user( &self, roomid: i64, tuid: i64, ) -> BpiResult<Option<Value>>

解除禁言

Source

pub async fn live_add_banned_user( &self, room_id: i64, anchor_id: i64, tuid: i64, ) -> BpiResult<Option<Value>>

拉黑观众 anchor_id:主播uid

Source

pub async fn live_del_banned_user( &self, room_id: i64, anchor_id: i64, tuid: i64, ) -> BpiResult<Option<Value>>

解除拉黑 anchor_id:主播uid

Source

pub async fn live_add_shield_keyword( &self, room_id: i64, keyword: String, ) -> BpiResult<Option<Value>>

添加屏蔽词

Source

pub async fn live_del_shield_keyword( &self, room_id: i64, keyword: String, ) -> BpiResult<Option<Value>>

删除屏蔽词

Trait Implementations§

Source§

impl<'a> Clone for LiveClient<'a>

Source§

fn clone(&self) -> LiveClient<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for LiveClient<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for LiveClient<'a>

§

impl<'a> !UnwindSafe for LiveClient<'a>

§

impl<'a> Freeze for LiveClient<'a>

§

impl<'a> Send for LiveClient<'a>

§

impl<'a> Sync for LiveClient<'a>

§

impl<'a> Unpin for LiveClient<'a>

§

impl<'a> UnsafeUnpin for LiveClient<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more