slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
MIT License
158 stars 27 forks source link

[QUERY] Access to interactive context via app_mention #208

Open tsarni opened 1 year ago

tsarni commented 1 year ago

Hi,

I would like to open a form or show a interactive dialog, once a user triggers a workflow by pinging the slack bot. I could not find the interactive_context as part of the TriggerContextData.Event.AppMentioned.*. Is there a way for me to push this dialog to the user? Are you planning to add the interactive context as part of the app mentioned event?

filmaj commented 1 year ago

Hmm, I am not sure this event would be able to provide an interactive context, as an interactive context is user-specific, but the event can come from any user (or even another app).

The idea behind interactivity triggers / contexts is that they are like a key to unlocking higher privileges in your app, allowing your app to open modals or create richer, but also more intrusive, user experiences. Because of the risk of potential abuse of the interactivity APIs (think infinite-ad-popup experience), we gate access to these APIs via interactivity contexts. These contexts are only provided when a specific user interacts with the Slack client in particular ways, such as clicking a link trigger or interacting with an interactive Block Kit element.

If you want to open a form or modal, I suggest triggering your workflow using a link trigger. Those always include an interactivity context.

tsarni commented 1 year ago

If I type as a user in a channel as "@bot message to the bot" then that in my mind could be considered as similar interactive context as to user typing a slash command "/bot message to the bot".

filmaj commented 11 months ago

@tsarni looked into this a bit more, and it is a bit more complex than what you describe. You could also schedule a message for posting in the future that includes a bot mention. Or another workflow or other bot could mention your bot. So app mentions (or more generally: messages) are not 100% guaranteed to originate from an end-user interaction.