def process(slack_event_type):
    """Process Slack events of a specific type

    This decorator will enable a Plugin method to process `Slack events`_ of a specific type. The
    Plugin method will be called for each event of the specified type that the bot receives.
    The received event will be passed to the method when called.

    .. _Slack events: https://api.slack.com/events

    :param slack_event_type: type of event the method needs to process. Can be any event supported
        by the RTM API
    :return: wrapped method
    """

    def process_decorator(f):
        f.metadata = getattr(f, "metadata", {})
        f.metadata['plugin_actions'] = f.metadata.get('plugin_actions', {})
        f.metadata['plugin_actions']['process'] = \
            f.metadata['plugin_actions'].get('process', {})
        f.metadata['plugin_actions']['process']['event_type'] = slack_event_type
        return f

    return process_decorator