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;
'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;
'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'});
our $client_secret;
our $signing_secret;
-our $oauth_token;
+our $slack_oauth_token;
our $jwt_key = {
"type" => "service_account",
"project_id" => "solskogen-cubemap",
our $dbname = 'skvidarlang';
our $dbuser = 'skvidarlang';
our $dbpass;
-our $oauth_token;
our $invitation_channel = 'C062GSYQ3C6';
# Read in a local configuration file if it exists.