Update subscription.py

This commit is contained in:
Believethehype 2024-04-04 13:27:56 +02:00
parent d325f3b66f
commit 6d379854d5

View File

@ -59,7 +59,7 @@ class Subscription:
if admin_config is not None:
for key in admin_config.USERNPUBS:
authors.append(PublicKey.parse(key))
dvm_filter = Filter().authors(authors).pubkey(pk).kinds([EventDefinitions.KIND_NIP90_DVM_SUBSCRIPTION.as_u64()]).since(Timestamp.now())
dvm_filter = Filter().authors(authors).pubkey(pk).kinds([EventDefinitions.KIND_NIP90_DVM_SUBSCRIPTION]).since(Timestamp.now())
self.client.subscribe([zap_filter, dvm_filter, cancel_subscription_filter], None)
@ -71,7 +71,7 @@ class Subscription:
keys = self.keys
def handle(self, relay_url, subscription_id, nostr_event: Event):
if nostr_event.kind().as_u64() == EventDefinitions.KIND_NIP90_DVM_SUBSCRIPTION.as_u64():
if nostr_event.kind().as_u64() == EventDefinitions.KIND_NIP90_DVM_SUBSCRIPTION.as_u64():
handle_nwc_request(nostr_event)
elif nostr_event.kind().as_u64() == EventDefinitions.KIND_NIP88_STOP_SUBSCRIPTION_EVENT.as_u64():
handle_cancel(nostr_event)