aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2016-09-10 22:42:33 -0400
committerTeddy Wing2016-09-10 22:42:33 -0400
commit99c105d4460813f0ae7e0f54f68a067cbf14bab4 (patch)
tree366ac2ff031ab4d8295bec54f342c82fc7675250
parent8c1334c34555276fb2bbd41ee9c258c34208958e (diff)
downloadirssi-slack-profile-99c105d4460813f0ae7e0f54f68a067cbf14bab4.tar.bz2
Add a setting for the Slack API token
Users can set this with `/set slack_profile_token`. It's required in order to query the Slack API.
-rw-r--r--slack-profile.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/slack-profile.pl b/slack-profile.pl
index 1a3f38f..79c2fe2 100644
--- a/slack-profile.pl
+++ b/slack-profile.pl
@@ -28,6 +28,8 @@ sub users_list {
my $ua = LWP::UserAgent->new;
$ua->agent('Mozilla/5.0');
+ $token = Irssi::settings_get_str('slack_profile_token');
+
my $req = HTTP::Request->new(GET => 'http://ip.jsontest.com/');
$req->header('content-type' => 'application/json');
@@ -103,3 +105,5 @@ sub swhois {
}
Irssi::command_bind('swhois', 'swhois');
+
+Irssi::settings_add_str('slack_profile', 'slack_profile_token', '');