This commit is contained in:
SovereigntyIsNotFreedom 2025-03-15 09:53:20 +00:00
parent 18b66a1358
commit 484a235b8b

View file

@ -30,15 +30,18 @@ def is_simplex_link_valid(simplex_link: str) -> bool:
websocket.send(json.dumps(command))
message = websocket.recv()
response = json.loads(message)
response_type = response['resp']['type']
if 'error' in response_type.lower():
print(f"Connection to this group {simplex_link} failed. Try again.")
try:
response_type = response['resp']['type']
if 'error' in response_type.lower():
print(f"Connection to this group {simplex_link} failed. Try again.")
return False
elif 'deleted' in response_type.lower():
print(f"Connection to this group {simplex_link} failed. Try again.")
return False
print('[+] Success!',response_type)
return True
except:
return False
elif 'deleted' in response_type.lower():
print(f"Connection to this group {simplex_link} failed. Try again.")
return False
print('[+] Success!',response_type)
return True
def check_groups_validity():
"""
@ -53,17 +56,20 @@ def check_groups_validity():
websocket.send(json.dumps(command))
message = websocket.recv()
response = json.loads(message)
for i in range(0,len(response['resp']['groups'])):
group_name = response['resp']['groups'][i][0]['groupProfile']['displayName']
# Description key sometimes are not supplied with .get() KeyError will occur
group_descr = response['resp']['groups'][i][0]['groupProfile'].get('description', "No description")
last_message_sent = response['resp']['groups'][i][0]['chatTs']
# Do something with this data
print(f"{group_name}")
print(group_descr)
print(f"{last_message_sent}\n")
# Only date
print(last_message_sent.split('T')[0])
try:
for i in range(0,len(response['resp']['groups'])):
group_name = response['resp']['groups'][i][0]['groupProfile']['displayName']
# Description key sometimes are not supplied with .get() KeyError will occur
group_descr = response['resp']['groups'][i][0]['groupProfile'].get('description', "No description")
last_message_sent = response['resp']['groups'][i][0]['chatTs']
# Do something with this data
print(f"{group_name}")
print(group_descr)
print(f"{last_message_sent}")
# Only date
print(f"{last_message_sent.split('T')[0]}\n")
except Exception:
print("An error occured. Try again.")