Update bot.py

This commit is contained in:
Believethehype 2024-06-14 19:58:05 +02:00
parent b751061881
commit 32664f8f9b

View File

@ -95,7 +95,7 @@ class Bot:
await handle_dm(nostr_event, False)
except Exception as e:
print(f"Error during content NIP04 decryption: {e}")
elif nostr_event.kind().match_enum(KindEnum.GIFT_WRAP()):
elif nostr_event.kind() == Kind.from_enum(KindEnum.GIFT_WRAP():
try:
await handle_dm(nostr_event, True)
except Exception as e:
@ -120,7 +120,7 @@ class Bot:
# Check timestamp of rumor
if rumor.created_at().as_secs() >= Timestamp.now().as_secs():
if rumor.kind() == Kind.from_enum(KindEnum.GIFT_WRAP()):
if rumor.kind() == Kind.from_enum(KindEnum.SEALED_DIRECT()):
decrypted_text = rumor.content()
print(f"Received new msg [sealed]: {decrypted_text}")
sealed = " [sealed] "