diff --git a/nostr/message_type.py b/nostr/message_type.py index 111553a..3f5206b 100644 --- a/nostr/message_type.py +++ b/nostr/message_type.py @@ -7,4 +7,9 @@ class RelayMessageType: EVENT = "EVENT" NOTICE = "NOTICE" END_OF_STORED_EVENTS = "EOSE" - \ No newline at end of file + + @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 \ No newline at end of file