Skip to content

Commit

Permalink
Fix incorrect key in users.list response parsing
Browse files Browse the repository at this point in the history
The users.list API response contains the key `members`, not `users`.
  • Loading branch information
kimjackson committed Sep 14, 2022
1 parent 542d55e commit d14614e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Slack/RTM/Bot/Client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ sub _refetch_users {
do {
$res = $ua->request(GET "https://slack.com/api/users.list?token=$self->{token}&cursor=$cursor");
my $args = JSON::from_json($res->content);
for my $user (@{$args->{users}}) {
for my $user (@{$args->{members}}) {
$users->{$user->{id}} = $user;
}
$cursor = $args->{response_metadata}->{next_cursor};
Expand Down

0 comments on commit d14614e

Please sign in to comment.