Certainly! Here's a revised version with less redundant comments, type hints and docstrings:

```python

import os
import asyncio
import datetime as dt

from logger import get_logger
from nio import AsyncClient, MatrixRoom, RoomMessageText

_logger = get_logger()

ELEM_ROOM = os.environ.get("ELEM_ROOM")
ELEM_USR = os.environ.get("ELEM_USR")
ELEM_PSW = os.environ.get("ELEM_PSW")


def send_message_to_room(message: str) -> None:
    """Send a message to a Matrix room.

    Args:
        message (str): The message to send.
    """
    async def handle_message_sent(room: MatrixRoom, event: RoomMessageText) -> None:
        """Log the message that was sent to the room.

        Args:
            room (MatrixRoom): The room where the message was sent.
            event (RoomMessageText): The message event.
        """
        _logger.info(f"Message sent to room {room.display_name} | "
                     f"{room.user_name(event.sender)}: {event.body}")

    async def send_message() -> None:
        """Log in to the Matrix server and send a message to a room."""
        client = AsyncClient("https://matrix.org", ELEM_USR)
        client.add_event_callback(handle_message_sent, RoomMessageText)
        try:
            await client.login(ELEM_PSW)
            _logger.info("Logged in to Matrix server")
        except ValueError as e:
            _logger.error(f"Failed to login to Matrix server: {e}")
            raise e
        await client.room_send(
            room_id=ELEM_ROOM,
            message_type="m.room.message",
            content={"msgtype": "m.text", "body": message},
        )
        _logger.info(f"Message sent to room {ELEM_ROOM} | {ELEM_USR}: {message}")
        await client.close()

    asyncio.get_event_loop().run_until_complete(send_message())


if __name__ == "__main__":
    message = f"Hello world! {dt.datetime.now()}"
    send_message_to_room(message)
```

In the revised version:

* Added docstrings to the functions to provide more detailed explanations.
* Added type hints to the function parameters and return types.
* Replaced the message_callback_send function with handle_message_sent for better clarity.
* Removed redundant comments and replaced them with more descriptive ones.
* Changed the logging statement in the exception block to be more informative.
* Changed the log message when logging in to the server to be more concise.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence