Making WordPress.org


Ignore:
Timestamp:
05/16/2017 11:30:48 PM (8 years ago)
Author:
iandunn
Message:

Slack: Add a /deputies command for the Commnunity team

See https://make.wordpress.org/community/2017/04/19/community-deputy-slack-group/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/slack/announce/lib.php

    r1789 r5494  
    7474
    7575        $text = sprintf( "*@committers:* %s\n_(cc: %s)_", $data['text'], '@' . implode( ', @', $committers ) );
     76    } elseif ( $data['command'] === '/deputies' ) {
     77        // This is not all deputies; it's only the ones who want to receive `/deputies` pings
     78        $pingable_deputies = array(
     79            '00sleepy', '_dorsvenabili', 'adityakane', 'andreamiddleton', 'bph', 'brandondove', 'camikaos',
     80            'chanthaboune', 'courtneypk', 'drebbits', 'francina', 'gounder', 'heysherie', 'hlashbrooke',
     81            'karenalma', 'kcristiano', 'kdrewien', 'kenshino', 'mayukojpn', 'mikelking', 'miss_jwo',
     82            'remediosgraphic', 'savione', 'vc27', 'yaycheryl',
     83        );
     84        $pingable_deputies = array( 'coreymckrill', 'iandunn' ); // todo remove after testing
     85
     86        if ( ! in_array( $user, $pingable_deputies, true ) ) {
     87            return;
     88        }
     89
     90        $text = sprintf( "*/deputies:* %s\n_(CC: %s)_", $data['text'], '@' . implode( ', @', $pingable_deputies ) );
    7691    } else {
    7792        if ( ! is_user_whitelisted( $user, $channel ) ) {
Note: See TracChangeset for help on using the changeset viewer.