pub struct Client {
pub uin: i64,
/* private fields */
}
Expand description
Fields§
§uin: i64
当前账号的 QQ 号。
Implementations§
source§impl Client
impl Client
sourcepub async fn set_friend_list_cache_time(&self, time: Duration)
pub async fn set_friend_list_cache_time(&self, time: Duration)
设置好友列表缓存过期时间。
Python
async def set_friend_list_cache_time(self, time: datetime.timedelta) -> None: ...
sourcepub async fn set_group_cache_time(&self, time: Duration)
pub async fn set_group_cache_time(&self, time: Duration)
sourcepub async fn set_group_member_list_cache_time(&self, time: Duration)
pub async fn set_group_member_list_cache_time(&self, time: Duration)
设置群成员列表缓存过期时间。
Python
async def set_group_member_list_cache_time(self, time: datetime.timedelta) -> None: ...
sourcepub fn account_info(self: &Arc<Self>) -> AccountInfoSelector
pub fn account_info(self: &Arc<Self>) -> AccountInfoSelector
sourcepub async fn get_account_info(
self: &Arc<Self>
) -> Result<AccountInfo, ReadAccountInfoError>
pub async fn get_account_info( self: &Arc<Self> ) -> Result<AccountInfo, ReadAccountInfoError>
sourcepub fn friend_list(self: &Arc<Self>) -> FriendListSelector
pub fn friend_list(self: &Arc<Self>) -> FriendListSelector
sourcepub async fn get_friend_list(
self: &Arc<Self>
) -> Result<Arc<FriendList>, FetchFriendListError>
pub async fn get_friend_list( self: &Arc<Self> ) -> Result<Arc<FriendList>, FetchFriendListError>
获取好友列表对象。
好友列表会被缓存,如果缓存未过期则直接返回缓存的值。
如果需要强制刷新好友列表缓存,请使用 flush_friend_list
。
Python
async def get_friend_list(self) -> FriendList: ...
sourcepub async fn flush_friend_list(
self: &Arc<Self>
) -> Result<(), FetchFriendListError>
pub async fn flush_friend_list( self: &Arc<Self> ) -> Result<(), FetchFriendListError>
sourcepub fn friend(self: &Arc<Self>, uin: i64) -> FriendSelector
pub fn friend(self: &Arc<Self>, uin: i64) -> FriendSelector
sourcepub async fn get_friend(
self: &Arc<Self>,
uin: i64
) -> Result<Option<Arc<Friend>>, FetchFriendInfoError>
pub async fn get_friend( self: &Arc<Self>, uin: i64 ) -> Result<Option<Arc<Friend>>, FetchFriendInfoError>
获取好友对象。
好友对象会缓存在好友列表缓存中,如果缓存未过期则直接返回缓存的值。
如果需要强制刷新好友对象缓存,请使用 FriendSelector::flush
或 flush_friend_list
。
Python
async def get_friend(self, uin: int) -> Friend | None: ...
sourcepub fn friend_group(self: &Arc<Self>, id: u8) -> FriendGroupSelector
pub fn friend_group(self: &Arc<Self>, id: u8) -> FriendGroupSelector
sourcepub async fn get_friend_group(
self: &Arc<Self>,
id: u8
) -> Result<Option<Arc<FriendGroup>>, FetchFriendGroupError>
pub async fn get_friend_group( self: &Arc<Self>, id: u8 ) -> Result<Option<Arc<FriendGroup>>, FetchFriendGroupError>
获取好友分组对象。
好友分组对象会缓存在好友列表缓存中,如果缓存未过期则直接返回缓存的值。
如果需要强制刷新好友分组对象缓存,请使用 FriendGroupSelector::flush
或 flush_friend_list
。
Python
async def get_friend_group(self, id: int) -> FriendGroup | None: ...
sourcepub fn group(self: &Arc<Self>, code: i64) -> GroupSelector
pub fn group(self: &Arc<Self>, code: i64) -> GroupSelector
sourcepub async fn get_group(
self: &Arc<Self>,
code: i64
) -> Result<Option<Arc<Group>>, FetchGroupInfoError>
pub async fn get_group( self: &Arc<Self>, code: i64 ) -> Result<Option<Arc<Group>>, FetchGroupInfoError>
获取群对象。
群对象会被缓存,如果缓存未过期则直接返回缓存的值。
如果需要强制刷新群对象缓存,请使用 GroupSelector::flush
。
Python
async def get_group(self, code: int) -> Group | None: ...
sourcepub async fn get_groups(
self: &Arc<Self>,
codes: Vec<i64>
) -> Result<HashMap<i64, Arc<Group>>, FetchGroupInfoError>
pub async fn get_groups( self: &Arc<Self>, codes: Vec<i64> ) -> Result<HashMap<i64, Arc<Group>>, FetchGroupInfoError>
获取多个群对象。
群对象会被缓存,如果缓存未过期则直接返回缓存的值。
如果需要强制刷新群对象缓存,请使用 MultiGroupSelector::flush
。
Python
async def get_groups(self, *codes: int) -> dict[int, Group]: ...
sourcepub fn all_groups(self: &Arc<Self>) -> AllGroupSelector
pub fn all_groups(self: &Arc<Self>) -> AllGroupSelector
sourcepub async fn get_all_groups(
self: &Arc<Self>
) -> Result<HashMap<i64, Arc<Group>>, FetchGroupInfoError>
pub async fn get_all_groups( self: &Arc<Self> ) -> Result<HashMap<i64, Arc<Group>>, FetchGroupInfoError>
sourcepub fn group_member(
self: &Arc<Self>,
group_code: i64,
uin: i64
) -> GroupMemberSelector
pub fn group_member( self: &Arc<Self>, group_code: i64, uin: i64 ) -> GroupMemberSelector
sourcepub async fn get_group_member(
self: &Arc<Self>,
group_code: i64,
uin: i64
) -> Result<Option<Arc<GroupMember>>, FetchGroupMemberInfoError>
pub async fn get_group_member( self: &Arc<Self>, group_code: i64, uin: i64 ) -> Result<Option<Arc<GroupMember>>, FetchGroupMemberInfoError>
获取群成员对象。
群成员对象会被缓存,如果缓存未过期则直接返回缓存的值。
如果需要强制刷新群成员对象缓存,请使用 GroupMemberSelector::flush
。
Python
async def get_group_member(self, group_code: int, uin: int) -> GroupMember | None: ...
sourcepub fn group_member_list(
self: &Arc<Self>,
group_code: i64
) -> GroupMemberListSelector
pub fn group_member_list( self: &Arc<Self>, group_code: i64 ) -> GroupMemberListSelector
sourcepub async fn get_group_member_list(
self: &Arc<Self>,
group_code: i64
) -> Result<Option<Arc<GroupMemberList>>, FetchGroupMemberListError>
pub async fn get_group_member_list( self: &Arc<Self>, group_code: i64 ) -> Result<Option<Arc<GroupMemberList>>, FetchGroupMemberListError>
获取群成员列表。
群成员列表会被缓存,如果缓存未过期则直接返回缓存的值。
如果需要强制刷新群成员列表缓存,请使用 GroupMemberListSelector::flush
。
Python
async def get_group_member_list(self, group_code: int) -> GroupMemberList | None: ...