def identify_slack_event(event):
    """Identify the Slack event type given an event object.

    Parameters
    ----------
    event : `dict`
        The Slack event object.

    Returns
    -------
    slack_event_type : `str`
        The name of the slack event, one of https://api.slack.com/events.
    """
    primary_type = event['event']['type']
    if primary_type == 'message':
        channel_type = event['event']['channel_type']
        if channel_type == 'channel':
            return 'message.channels'
        if channel_type == 'im':
            return 'message.im'
        elif channel_type == 'group':
            return 'message.groups'
        elif channel_type == 'mpim':
            return 'message.mpim'
        else:
            raise RuntimeError(f'Unknown channel type {channel_type!r}')
    else:
        return primary_type