def internal_send_stream_message(realm: Realm, sender: UserProfile, stream: Stream, topic: str, content: str, email_gateway: bool=False) -> Optional[int]:
    message = internal_prep_stream_message(realm, sender, stream, topic, content)
    if (message is None):
        return None
    message_ids = do_send_messages([message], email_gateway=email_gateway)
    return message_ids[0]
def internal_send_stream_message(realm: Realm, sender: UserProfile, stream: Stream, topic: str, content: str, email_gateway: bool=False) -> Optional[int]:
    message = internal_prep_stream_message(realm, sender, stream, topic, content)
    if (message is None):
        return None
    message_ids = do_send_messages([message], email_gateway=email_gateway)
    return message_ids[0]