SlackAPI icon indicating copy to clipboard operation
SlackAPI copied to clipboard

SlackTaskClient is getting `method_deprecated` errors several API's

Open ramonsmits opened this issue 4 years ago • 4 comments

SlackTaskClient is getting method_deprecated errors several API's

  • GetDirectMessageListAsync
  • GetChannelListAsync

As I want to use the Task based client I'm not sure how to resolve these issues.

ramonsmits avatar Mar 24 '21 10:03 ramonsmits

SlackTaskClient is getting method_deprecated errors several API's

  • GetDirectMessageListAsync
  • GetChannelListAsync

As I want to use the Task based client I'm not sure how to resolve these issues.

@ramonsmits try now from the latest, it should be fixed.

ifonya105 avatar Mar 31 '21 14:03 ifonya105

@ifonya105 Just tested GetDirectMessageListAsync and it still returns the same message.

Maybe the SlackTaskClient hasn't been updated yet?

ramonsmits avatar Apr 27 '21 14:04 ramonsmits

Tested is with SlackClient which gives me the same result:

var client = new SlackTaskClient(Token);
var channels = await client.GetDirectMessageListAsync();

ramonsmits avatar Apr 28 '21 06:04 ramonsmits

Ok, so GetDirectMessageListAsync should be removed I guess.

I got it to work by doing the following:

var client = new SlackTaskClient(Token);
var users = await client.GetUserListAsync();
var user = users.members.Single(x => x.name.Equals(name));

var response = await client.JoinDirectMessageChannelAsync(user.id);
channelId = response.channel.id;

ramonsmits avatar Apr 28 '21 07:04 ramonsmits