import aiohttp


async def cleanup_file(slack_api_token, file):
    """Deletes a file from Slack."""
    headers = {"Authorization": "Bearer {}".format(slack_api_token)}
    data = {"file": file["id"]}
    async with aiohttp.ClientSession() as session:
        async with session.post('https://slack.com/api/files.delete', headers=headers, data=data) as resp:
            if resp.status == 200:
                return True
            return False