添加新 api,我感觉可以发版了

This commit is contained in:
shenjack-5600u 2025-04-06 19:27:09 +08:00
parent 3d08a7da91
commit 86ab23e45d
Signed by: shenjack
GPG Key ID: FDF9864E11C7E79F
2 changed files with 25 additions and 0 deletions

View File

@ -70,6 +70,23 @@ impl IcaStatusPy {
pub fn get_rooms(&self) -> Vec<IcaRoomPy> { pub fn get_rooms(&self) -> Vec<IcaRoomPy> {
MainStatus::global_ica_status().rooms.iter().map(|r| r.into()).collect() MainStatus::global_ica_status().rooms.iter().map(|r| r.into()).collect()
} }
#[getter]
/// 获取所有管理员
///
/// 添加自 2.0.1
pub fn get_admins(&self) -> Vec<UserId> {
MainStatus::global_config().ica().admin_list.clone()
}
#[getter]
/// 获取所有被屏蔽的人
///
/// (好像没啥用就是了, 反正被过滤的不会给到插件)
///
/// 添加自 2.0.1
pub fn get_filtered(&self) -> Vec<UserId> {
MainStatus::global_config().ica().filter_list.clone()
}
} }
impl Default for IcaStatusPy { impl Default for IcaStatusPy {

View File

@ -21,3 +21,11 @@
- `def new_message_to(self, content: str) -> IcaSendMessage` - `def new_message_to(self, content: str) -> IcaSendMessage`
- 用于创建一条指向这个房间的消息 - 用于创建一条指向这个房间的消息
> 添加了 Ica 侧的相关配置获取
- `IcaStatus` 添加了 `admins(self) -> list[UserId]` 方法
- 用于获取当前所有的管理员
- `IcaStatus` 添加了 `blocked(self) -> list[UserId]` 方法
- 用于获取当前所有的被屏蔽的人