mirror of
https://github.com/aljazceru/python-nostr.git
synced 2025-12-19 15:24:19 +01:00
add is_valid method to RelayMessageType class
This commit is contained in:
@@ -7,4 +7,9 @@ class RelayMessageType:
|
|||||||
EVENT = "EVENT"
|
EVENT = "EVENT"
|
||||||
NOTICE = "NOTICE"
|
NOTICE = "NOTICE"
|
||||||
END_OF_STORED_EVENTS = "EOSE"
|
END_OF_STORED_EVENTS = "EOSE"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def is_valid(type: str) -> bool:
|
||||||
|
if type == RelayMessageType.EVENT or type == RelayMessageType.NOTICE or type == RelayMessageType.END_OF_STORED_EVENTS:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
Reference in New Issue
Block a user