Botkit: [Slack] im.open is deprecated

Created on 4 Jul 2020  Â·  10Comments  Â·  Source: howdyai/botkit

Are you sure this is an issue with the Botkit core module?

Fairly sure, yes.

What are you trying to achieve or the steps to reproduce?

Attempting to begin a direct message with a Slack user throws a deprecation warning:

````ts
const bot = await controller.spawn(SlackTeamId);

const slackEmail = "[email protected]";
const slackLookupResponse = await bot.api.users.lookupByEmail({ email: slackEmail });
const slackId = slackLookupResponse.user.id;
await bot.startPrivateConversation(slackId);

await bot.say("Anything");
````

What was the result you received?

[WARN]  web-api:WebClient:0 im.open is deprecated. Please use the Conversations API instead. For more info, go to https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api
[ERROR]  web-api:WebClient:0 This method is retired and can no longer be used. Please use conversations.open instead. Learn more: https://api.slack.com/changelog/2020-01-deprecating-antecedents-to-the-conversations-api.
(node:1088) UnhandledPromiseRejectionWarning: Error: An API error occurred: method_deprecated
    at Object.platformErrorFromResult (/Users/hayden/development/PlayerData/beaverbot/node_modules/@slack/web-api/src/errors.ts:94:5)
    at WebClient.apiCall (/Users/hayden/development/PlayerData/beaverbot/node_modules/@slack/web-api/src/WebClient.ts:188:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(Use `node --trace-warnings ...` to show where the warning was created)

What did you expect?

A direct message "anything" sent to the user id.

Screenshots and animated GIFs

Context:

  • Botkit version: 4.9.0
  • Messaging Platform: Slack
  • Node version: v14.4.0
  • Os: MacOS
  • Any other relevant information:

Most helpful comment

@benbrown
createPrivateConversation method also gives "im.open is deprecated" message in latest legacy version (0.7.6) as well.
Will it be corrected?

All 10 comments

I am also encountering this issue.

Same issue here.

This is fixed by https://github.com/howdyai/botkit/pull/1989, which will be included in "the next release".

@benbrown would you be able to give an indicative date for the next release please - it's been over a month?

This is an important fix, as notifications are not working on Slack for newly created apps.
Is there a workaround we could adopt before the next release?
Thanks

A version of the adapter with this fix has been published! Snag 1.0.12 from npm.

Thanks @benbrown

Thank you @benbrown!

@benbrown
createPrivateConversation method also gives "im.open is deprecated" message in latest legacy version (0.7.6) as well.
Will it be corrected?

@benbrown
I am also encountering @icsandesh issue.
Will it be corrected?

I just edited the library change from im.open to conversation.open in
original code. using this custom library for now.

On Wed, Jan 27, 2021 at 5:32 AM Fernando Michel notifications@github.com
wrote:

I found a similar used but when I try to convo.say inside the
createPrivateConversation, this used to work

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/howdyai/botkit/issues/1988#issuecomment-767910290,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADFFAOD4MCJL7FFOJELE443S35JX3ANCNFSM4OQQJNAA
.

--
ic sandesh indavara

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RafaelCosman picture RafaelCosman  Â·  4Comments

matueranet picture matueranet  Â·  4Comments

abinashmohanty picture abinashmohanty  Â·  4Comments

fieldcorbett picture fieldcorbett  Â·  4Comments

HannanShaik picture HannanShaik  Â·  3Comments