# Path: phial/utils.py
# def parse_slack_output(slack_rtm_output: List[Dict]) -> Optional["Message"]:
#     """Parse Slack output."""
#     output_list = slack_rtm_output
#     if output_list and len(output_list) > 0:
#         for output in output_list:
#             if output and "text" in output:
#                 bot_id = None
#                 team = None
#                 if "team" in output:
#                     team = output["team"]
#                 if "bot_id" in output:
#                     bot_id = output["bot_id"]
# 
#                 return Message(
#                     output["text"],
#                     output["channel"],
#                     output["user"],
#                     output["ts"],
#                     team,
#                     bot_id,
#                 )
#     return None


from typing import Dict, List
from phial.utils import parse_slack_output
    assert output.timestamp == "ts"
    assert output.team == "team"
    assert output.bot_id is None


def test_parse_slack_output_bot() -> None:
    """Test returns bot Message correctly."""
    sample_input = [
        {
            "text": "test",
            "channel": "channel",
            "user": "user",
            "ts": "ts",
            "team": "team",
            "bot_id": "bot",
        }
    ]
    output = parse_slack_output(sample_input)
    assert output is not None
    assert output.channel == "channel"
    assert output.team == "team"
    assert output.text == "test"
    assert output.timestamp == "ts"
    assert output.team == "team"
    assert output.bot_id == "bot"


def test_parse_slack_output_returns_none_on_empty_input() -> None:
    """Check returns None when no messages passed in."""
    sample_input: List[Dict[str, str]] = []

# Path: phial/utils.py
# def parse_slack_output(slack_rtm_output: List[Dict]) -> Optional["Message"]:
#     """Parse Slack output."""
#     output_list = slack_rtm_output
#     if output_list and len(output_list) > 0:
#         for output in output_list:
#             if output and "text" in output:
#                 bot_id = None
#                 team = None
#                 if "team" in output:
#                     team = output["team"]
#                 if "bot_id" in output:
#                     bot_id = output["bot_id"]
# 
#                 return Message(
#                     output["text"],
#                     output["channel"],
#                     output["user"],
#                     output["ts"],
#                     team,
#                     bot_id,
#                 )
#     return None


# Path: tests/utils/test_parse_slack_output.py
from typing import Dict, List
from phial.utils import parse_slack_output

    assert output.timestamp == "ts"
    assert output.team == "team"
    assert output.bot_id is None


def test_parse_slack_output_bot() -> None:
    """Test returns bot Message correctly."""
    sample_input = [
        {
            "text": "test",
            "channel": "channel",
            "user": "user",
            "ts": "ts",
            "team": "team",
            "bot_id": "bot",
        }
    ]
    output = parse_slack_output(sample_input)
    assert output is not None
    assert output.channel == "channel"
    assert output.team == "team"
    assert output.text == "test"
    assert output.timestamp == "ts"
    assert output.team == "team"
    assert output.bot_id == "bot"


def test_parse_slack_output_returns_none_on_empty_input() -> None:
    """Check returns None when no messages passed in."""
    sample_input: List[Dict[str, str]] = []

    output = parse_slack_output(sample_input)