def checkEventType(event: dict) -> bool: structure = { 'type': 'm.room.canonical_alias', 'content': { 'alias': str } } return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = { 'type': 'n.output.error', 'content': { 'command': str, 'message': str } } return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = { 'type': 'm.room.join_rules', 'content': { 'join_rule': str } } return (checkStructure(event, structure) and event['content']['join_rule'] in JoinRules.joinTypes)
def checkEventType(event: dict) -> bool: structure = { 'type': 'm.room.message', 'content': { 'body': str, 'msgtype': str } } return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'type': 'm.room.topic', 'content': {'topic': str}} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'unsigned': {'redacted_because': {'event_id': str}}} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'type': 'm.room.redaction', 'redacts': str} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'type': 'm.room.power_levels'} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'prev_content': {'membership': 'join'}} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'prev_content': {'membership': 'join'}} if event['state_key'] == event['sender']: return (False) return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'type': 'm.room.member', 'content': {'membership': str}} return (checkStructure(event, structure) and event['content']['membership'] in RoomMember.membershipTypes)
def checkEventType(event: dict) -> bool: structure = {'type': 'm.room.create', 'content': {'creator': str}} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'type': 'm.room.aliases', 'content': {'aliases': list}} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'state_key': str} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'event_id': str, 'sender': str, 'origin_server_ts': int} # Note that required field room_id is NOT checked # This is because events received through /sync do not include this field return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'content': {'membership': 'leave'}} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'content': {'msgtype': 'm.emote'}} return (checkStructure(event, structure))
def checkEventType(event: dict) -> bool: structure = {'type': str, 'source': 'Nutmeg', 'content': {}} return (checkStructure(event, structure))