diff --git a/apitypes.py b/apitypes.py index a3568c5..357549c 100644 --- a/apitypes.py +++ b/apitypes.py @@ -61,6 +61,10 @@ class CreateGroupRequest(BaseModel): class CreateGroupResponse(BaseModel): id: str +class UpdateGroupResult(BaseModel): + members_added: List[str] + members_removed: List[str] + def test_reaction_message(): data = """{ "envelope": { diff --git a/main.py b/main.py index 4afd2a1..a3983ec 100644 --- a/main.py +++ b/main.py @@ -93,7 +93,7 @@ class SignalAPI: print("Failed to remove group members") print(r.json()) - def update_group_members(self, group_id: str, other_members: List[str]) -> Result[None, str]: + def update_group_members(self, group_id: str, other_members: List[str]) -> Result[UpdateGroupResult, str]: group = self.get_group(group_id) if is_err(group): return Err(group.unwrap_err()) @@ -121,7 +121,7 @@ class SignalAPI: if remove_result.is_err(): return Err(remove_result.unwrap_err()) - return Ok(None) + return Ok(UpdateGroupResult(members_added=members_to_add, members_removed=members_to_remove)) def get_identities(self) -> Result[List[IdentityEntry], str]: r = requests.get(f"{self.apiurl}/v1/identities/{self.number}")