]> git.sesse.net Git - skvidarsync/blobdiff - bin/sync.pl
Rename $config::oauth_token to $config::slack_oauth_token, for clarity.
[skvidarsync] / bin / sync.pl
index 4bf7085bdec3a4a6f1ababdb06a79df3eb82397a..3dfabce8a0baea126d1b217f58335cf5f5085b25 100644 (file)
@@ -39,7 +39,7 @@ sub get_oauth_bearer_token {
 sub get_slack_name {
        my ($ua, $userid) = @_;
        my $req = HTTP::Request->new('GET', 'https://slack.com/api/users.info?user=' . $userid, [
-              'Authorization' => 'Bearer ' . $config::oauth_token
+              'Authorization' => 'Bearer ' . $config::slack_oauth_token
        ]);
        my $response = $ua->request($req);
        die $response->status_line if !$response->is_success;
@@ -279,7 +279,7 @@ sub possibly_nag_user {
                'https://slack.com/api/conversations.open',
                Content => JSON::XS::encode_json({ users => [ $userid ] }),
                Content_type => 'application/json;charset=UTF-8',
-               Authorization => 'Bearer ' . $config::oauth_token
+               Authorization => 'Bearer ' . $config::slack_oauth_token
        );
        die $response->status_line if !$response->is_success;
 
@@ -293,7 +293,7 @@ sub possibly_nag_user {
                'https://slack.com/api/chat.postMessage',
                Content => JSON::XS::encode_json({ channel => $channel_id, text => $msg }),
                Content_type => 'application/json;charset=UTF-8',
-               Authorization => 'Bearer ' . $config::oauth_token
+               Authorization => 'Bearer ' . $config::slack_oauth_token
        );
        my $msg_json = JSON::XS::decode_json($response->decoded_content);
        die "Something went wrong: " . $response->decoded_content if (!defined($msg_json) || !$msg_json->{'ok'});