Change contract for commands to return full event

This commit is contained in:
Alex Wolden 2025-04-14 11:10:59 -07:00
parent 39ea3cb3f3
commit 6fbf15885d
17 changed files with 231 additions and 104 deletions

View file

@ -37,13 +37,17 @@ async def main():
# Send the message and get the MSG_SENT event
print(f"Sending message: '{args.message}'")
send_result = await mc.commands.send_msg(
result = await mc.commands.send_msg(
contact,
args.message
)
if result.type == EventType.ERROR:
print(f"⚠️ Failed to send message: {result.payload}")
return
# Extract the expected ACK code
expected_ack = send_result["expected_ack"].hex()
expected_ack = result.payload["expected_ack"].hex()
print(f"Message sent, waiting for ACK with code: {expected_ack}")
# Wait for the specific ACK that matches our message