diff --git a/main.py b/main.py index 4a73d8a..c91f3d5 100644 --- a/main.py +++ b/main.py @@ -166,7 +166,7 @@ class SignalAPI: if r.status_code == 204: return Ok(None) else: - return Err(r.json().error) + return Err(r.json()['error']) def remove_group_admins(self, group_id: str, admins: List[str]) -> Result[None, str]: r = requests.delete(f"{self.apiurl}/v1/groups/{self.number}/{group_id}/admins", json={"admins": admins}) @@ -174,7 +174,7 @@ class SignalAPI: if r.status_code == 204: return Ok(None) else: - return Err(r.json().error) + return Err(r.json()['error']) def update_group_admins(self, group_id: str, other_admins: List[str], remove: bool = True) -> Result[Changes[str], str]: # Add and remove admins from the group, such that the only remaining @@ -233,7 +233,7 @@ class SignalAPI: if r.status_code == 201: return parse_response(SendMessageResponse, r.text) else: - return Err("Failed to send message") + return Err(r.json()['error']) class LabCleaningBot: