slackapi / bolt-js

A framework to build Slack apps using JavaScript
https://slack.dev/bolt-js
MIT License
2.73k stars 391 forks source link

Is it possible to indicate "Bot user typing... " using boltjs #885

Closed dennismphil closed 3 years ago

dennismphil commented 3 years ago

Description

Describe your issue here. Using Bolt JS is it possible to emit an event showing a typing indicator. I noted this was possible using the node-slack-sdk https://github.com/slackapi/node-slack-sdk/issues/98

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


mwbrooks commented 3 years ago

Hey @dennismphil,

The user_typing event is a feature of the RTM API, but unfortunately it's not available in the Events API or Web API. As a warning, the RTM API is deprecated and only available to classic Slack apps. If you're submitting to the App Directory, you will not be able to submit a classic Slack app.

This comment https://github.com/slackapi/node-slack-sdk/issues/1130#issuecomment-740149464 goes into some details on why this decision was made and some possible workarounds if creating the "bot is typing..." is important to you.

Hope that helps! Michael

migsterrrrr commented 1 year ago

Are you revisiting this given conversational bots are on the up? I love the fact that chat GPT is typing slowly when talking, it's bot like, but consumable. I wonder if you can build something similar, like throttling the message created by apps?

seratch commented 1 year ago

@migsterrrrr The only approach that we can suggest is to use chat.update API to reflect progress in the same message. This means that you can start with posting a message like "Now processing ..." using chat.postMessage API, and then you can call chat.update API to update the message. I know that this may not be ideal for you, but we don't have any plans to enhance chat.* APIs for your use case at least in the short term.

martinseanhunt commented 1 year ago

An alternative to this would be to allow more generous rate limits while using websockets, allowing us to stream a response while working with conversational, llm driven applications.

glennblock commented 1 year ago

Thanks for this. @seratch Would an ascii spinner (think terminal / bbs days) work here or adding dots to an existing message? Imagine on some sort of interval. We have an AI bot and responses can take a bit. We were thinking of something along these lines to keep the user informed that it is "thinking".

Would be nice if Slack just had an API that lets you turn on / off "Bot is typing", or better yet as @martinseanhunt said a way to start streaming in word by word, though I imagine that could be a significantly bigger lift.

david1542 commented 8 months ago

I'm joining to @martinseanhunt comment. It'd be extremely useful to allow streaming of messages into Slack. LLMs responses usually take 5-20 seconds so it'd develop the user experience.