def __get_token(config: dict) -> str:
    """Gets the token from the configuration, with some sanity checks."""
    if 'token' not in config:
        raise ValueError("No token found in the configuration.")
    token = config['token']
    if not isinstance(token, str):
        raise ValueError(f'The token must be a string, found a {type(token).__name__}.')
    if not token.startswith('xoxb-'):
        raise ValueError(f'The token does not appear to be a bot token.')
    return token