async def _send_file(client, channel: str, file: Union[(Path, str)], title):
    'Sends a file to a channel, with basic logging & error handling.'
    if isinstance(file, Path):
        file = str(file.absolute())
    try:
        (await client.files_upload(channels=channel, file=file, title=title))
    except SlackApiError as e:
        logging.exception(f"error from Slack API when trying to upload file: {e.response['error']}")
        print('Encountered SlackApiError when trying to upload file (see logs.)')
    except AttributeError:
        logging.exception('suspected issue in Slack API when trying to upload file. This bug has occured before!')
        print('Encountered AttributeError when trying to upload file (see logs.)')
Sends a file to a channel, with basic logging & error handling.
async def _send_file(client, channel: str, file: Union[(Path, str)], title):
    
    if isinstance(file, Path):
        file = str(file.absolute())
    try:
        (await client.files_upload(channels=channel, file=file, title=title))
    except SlackApiError as e:
        logging.exception(f"error from Slack API when trying to upload file: {e.response['error']}")
        print('Encountered SlackApiError when trying to upload file (see logs.)')
    except AttributeError:
        logging.exception('suspected issue in Slack API when trying to upload file. This bug has occured before!')
        print('Encountered AttributeError when trying to upload file (see logs.)')