-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete previous messages based on their content, these messages were sent before matrix-commander establishment #8
Comments
I just had a similar issue with OC3K |
On the already extablished LemnosLife VPS matrix-commander --os-notify returns silently. matrix-commander -l
but there is no additional content when both ends send a message to each other... matrix-commander -t 3 --print-event-id start returning interesting results. In fact it seems by default to only consider sent messages. Make the other end send a message make However, only seems to retrieve the ciphertext and not the plaintext:
matrix-commander --listen tail
matrix-commander --listen TAIL
Seems related to matrix-commander/issues/47. Just being able to see in plaintext new messages would be a good start. However, messages even sent by matrix-commander do not seem retrievable as plaintext. Should investigate:
|
Giving a try to Element desktop matrix-commander --room-redact '!CENSORED:matrix.org' 'CENSORED' works.
#!/usr/bin/python3
import json
with open('messages.json') as f:
data = json.load(f)
messages = data['messages']
for message in messages:
body = message['content'].get('body', '')
if 'is not reachable by keyboard' in body:
print(message['event_id']) cat messages_to_delete.txt | while read line
do
matrix-commander --room-redact '!CENSORED:matrix.org' "$line"
done does the trick but face: 2024-04-11 17:29:41,804: ERROR: matrix-commander: E213: Failed to redact event CENSORED in room !CENSORED:matrix.org with reason 'None'. Response: RoomRedactError: M_LIMIT_EXCEEDED Too Many Requests - retry after 354ms Test Should integrate directly
#!/usr/bin/python3
import json
import subprocess
import shlex
from tqdm import tqdm
# Assuming having joined a single room, which is my bot case.
ROOM_ID = subprocess.check_output('matrix-commander --joined-rooms', shell = True).decode('ascii')[:-1]
REASON = 'Spam'
with open('messages.json') as f:
data = json.load(f)
messages = data['messages']
eventIds = [message['event_id'] for message in messages if 'selenium.common.exceptions.TimeoutException: Message: Navigation timed out after 300000 ms' in message['content'].get('body', '')]
for eventId in tqdm(eventIds):
print(f'{eventId = }')
output = subprocess.check_output(f'matrix-commander --room-redact {shlex.quote(ROOM_ID)} {shlex.quote(eventId)} {shlex.quote(REASON)}', shell = True)
print(f'{output = }') |
ROOM=`matrix-commander --joined-rooms`
matrix-commander --room-redact "$ROOM" '$CENSORED' '' "$ROOM" '$CENSORED' '' |
#!/usr/bin/python3
import json
import subprocess
import shlex
ROOM_ID = subprocess.check_output('matrix-commander --joined-rooms', shell = True).decode('ascii')[:-1]
REASON = 'Spam'
with open('messages.json') as f:
data = json.load(f)
messages = data['messages']
eventIds = [message['event_id'] for message in messages if 'selenium.common.exceptions.TimeoutException: Message: Navigation timed out after 300000 ms' in message['content'].get('body', '')]
arguments = ' '.join([' '.join([shlex.quote(ROOM_ID), shlex.quote(eventId), shlex.quote(REASON)]) for eventId in eventIds])
command = f'matrix-commander --room-redact {arguments}'
print(f'{command = }')
output = subprocess.check_output(command, shell = True)
print(f'{output = }') |
|
Related to YouTube-operational-API/issues/237.
The text was updated successfully, but these errors were encountered: