signal-cli-rest-api
signal-cli-rest-api copied to clipboard
How to remove empty members from a group
I'm using the following code to get group info:
base="http://localhost:8080/" number=env("SIGNAL_PHONENUMBER") url=base + f"v1/groups/{number}" print(url) requests.get(url).json()
resulting in:
{'name': 'XXX', 'id': 'group......=', 'internal_id': '.....=', 'members': ['+1234567890', '', '', '', ''], 'blocked': False, 'pending_invites': [], 'pending_requests': [], 'invite_link': 'https://signal.group/.....', 'admins': ['+31234567890, '']}]
I want to get rid of the empty members in the group since they result in an error message* when sending a message to the group
# *error message: SignalCliRestApiError: Failed to send (some) messages:<deleted info>: Unregistered user "<deleted id>" (8 additional frame(s) were not displayed)
I tried to remove them through the signal app itself, but that does not seem to work. I tried using a DELETE request as follows (probably obvious):
`data={"members": [""]}
base="http://localhost:8080/" groupid="group.VXI1ODJnY01QcnBOckZiZVhNMVNGZVArcmtpS0lyNC9yUmRBUHhFWjV3Zz0=" number=env("SIGNAL_PHONENUMBER") url=base + f"v1/groups/{number}/{groupid}/delete" print(url) result = requests.delete(url, json=data) result.text `
Any ideas?
Are you sure that those are empty members and not just members who have hidden their number? (see also https://github.com/bbernhard/signal-cli-rest-api/issues/611)