Skip to content
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

Can we receive DMs? #76

Open
yaohaizhou opened this issue Feb 20, 2023 · 1 comment
Open

Can we receive DMs? #76

yaohaizhou opened this issue Feb 20, 2023 · 1 comment

Comments

@yaohaizhou
Copy link

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?

@blackcoffeexbt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants