Itiviti / simple-slack-api

(simple) Java Slack client library
470 stars 193 forks source link

Incorrect parameter name for conversations.invite command #284

Closed sergey-morenets closed 2 years ago

sergey-morenets commented 3 years ago

Hi

Current implementation of inviteToChannel method uses "user" parameter to pass user identifier to Slack API:

@Override
public SlackMessageHandle<SlackChannelReply> inviteToChannel(SlackChannel channel, SlackUser user) {
  SlackMessageHandle<SlackChannelReply> handle = new SlackMessageHandle<>(getNextMessageId());
  Map<String, String> arguments = new HashMap<>();
  arguments.put("token", authToken);
  arguments.put("channel", channel.getId());
  arguments.put("user", user.getId());
  postSlackCommand(arguments, CONVERSATION.INVITE_COMMAND, handle, SlackChannelReply.class);
  return handle;
}

However current conversations.invite command uses "users" argument (https://api.slack.com/methods/conversations.invite). So any request to invite a valid user to the channel always returns "no_user" error.

moults31 commented 3 years ago

Fixed on my fork in https://github.com/moults31/simple-slack-api/pull/5. It's a simple fix as expected, but note that it depends on #283 if you don't have a legacy Slack app.

sergey-morenets commented 3 years ago

Fixed on my fork in moults31#5. It's a simple fix as expected, but note that it depends on #283 if you don't have a legacy Slack app.

Thank you, @moults31

sergey-morenets commented 2 years ago

Hi @bcorne

When are you going to publish new version? It seems that 1.3.0(last published) doesn't contain this fix.