From 85d287ab53e923061219cab66d866194d509df01 Mon Sep 17 00:00:00 2001 From: BlueGlassBlock Date: Tue, 14 Mar 2023 12:33:02 +0800 Subject: [PATCH] feat: delete friend See #17 --- python/ichika/core/__init__.pyi | 1 + src/client/mod.rs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/python/ichika/core/__init__.pyi b/python/ichika/core/__init__.pyi index 3bf4130..0f10ef6 100644 --- a/python/ichika/core/__init__.pyi +++ b/python/ichika/core/__init__.pyi @@ -172,6 +172,7 @@ class PlumbingClient: async def get_friends(self) -> VTuple[Friend]: ... async def find_friend(self, uin: int) -> Friend | None: ... async def nudge_friend(self, uin: int) -> None: ... + async def delete_friend(self, uin: int) -> None: ... # [impl 3] async def get_group(self, uin: int) -> Group: ... async def get_group_raw(self, uin: int) -> Group: ... diff --git a/src/client/mod.rs b/src/client/mod.rs index e3db4f4..1f20568 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -172,6 +172,14 @@ impl PlumbingClient { Ok(()) }) } + + pub fn delete_friend<'py>(&self, py: Python<'py>, uin: i64) -> PyResult<&'py PyAny> { + let client = self.client.clone(); + py_future(py, async move { + client.delete_friend(uin).await?; + Ok(()) + }) + } } #[pymethods]