python-nostr
python-nostr copied to clipboard
Can we receive DMs?
I try to use python-nostr to send a direct message to my Damus account and it works well. I am wondering how we can receive DMs using this tool?
You can use this snippet
private_key = PrivateKey(hex_to_raw_bytes("PRIVATE KEY HEX"))
dmContent = private_key.decrypt_message(dmContent, senderPubKey)
where dmContent = ['content'] from a received event and senderPubKey = ['pubkey'] from the event.