0

Is there a way to keep my Slack App from being used in Channels?

I only want the current user to be able to interact with the App directly and it not to show in any channels.

When setting up a app in MS Teams using App Studio there is a option that lets you limit the App to "Personal" I'm looking for something similar in Slack.

Tyler
  • 1,019
  • 12
  • 27

1 Answers1

0

I am not sure what use cases you want to prohibit exactly, but in general your app can check each incoming request and decide if and how it wants to react to it.

For example you will always get the user ID of who sent the slash command or message to the bot. You can use that to filter our users that should not have access.

Update

To restrict your app the the app channel you need to do the following:

  • When receiving a request from the user, first open a direct message channel to the user from the bot user. That will always give you the channel ID of the app channel.

  • Then reply with a direct message in that app channel

  • or alternatively check if the received request is from the app channel and ask the user to only talk in app channel if it is not.

See also this answer on how this works in detail.

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • The messages returned from my App are only meant for the current user and nobody else should be able to see them. So I would like to keep my App from being used outside of its own channel. – Tyler Apr 23 '20 at 03:38
  • Why not use ephemeral messages? – Erik Kalkoken Apr 23 '20 at 13:59
  • I would hope there is a better option, since the end user might think that using the app in a public channel would show the Messages to everyone. – Tyler Apr 23 '20 at 16:17