Creating a Slack Bot
ollow these steps to connect your bot to Slack:
- In Flow XO, click Channels in the top menu bar, then choose + New.
- Now choose Slack as the messaging platform.
- Type in a Name for the bot.
- Now we'll head over to Slack at https://api.slack.com/apps/new.
- Choose to create a bot 'From scratch'
- Give your new app a name and select Development Slack Workspace. Click Create App
- Fill in any other Basic Information for the app, including features and functionality, setting an icon, name, description, etc.. When you're done, click Save Changes.
- Click on OAuth & Permissions on the left menu. In the Redirect URLs section click Add New Redirect URL. Copy the Slack App Redirect URI from Flow XO into the redirect URL, click Add and then click Save URLs.
Scopes
Add the following Bot Token Scopes:
- app_mentions: read
- channels:history
- channels:join
- chat:write
- chat:write.public
- commands
- groups:history
- im:history
- incoming-webhook
- mpim:history
- users:read
- users:write
Also add the following User Token Scope:
- channels:history
When you are done, your scopes should look like this:
- Click on Event Subscriptions
- Click Enable Subscriptions
- in the Request URL, paste the value from Slack App Interactive Message Action URL in the Flow XO Bot Configuration screen
- Expand "Subscribe to bot events"
- Click "Add Bot User Event" and add the following events:
- message.channels
- message.groups
- message.im
- message.mpim
- app_mention
- app_home_opened
- Click "Save Changes" at the bottom of the form
- Click on Interactivity & Shortcuts on the left menu in Slack and enable Interactivity. Enable interactivity and copy the Slack App Interactive Messages Action URL from Flow XO into the Request URL field and then click Save Changes.
- Next, click 'App Home' under the 'Features' heading, and check 'Allow users to send Slash commands and messages from the messages tab'. This will allow you to create a direct session with your bot.
- Now click on Basic Information on the left, and you'll see your App Credentials. You'll then need to copy the Client ID and Client Secret into Flow XO.
- You can optionally fill in a Success URL. If you leave this blank, the user will be redirected to their Slack team after installing your bot. This is usually a good thing to do, but if you prefer, type a different URL to send the user to here.
- Now that's done, click Next to save those details and your bot is configured!
- The final step invites you to install your bot into your own team. Follow the steps on screen. You'll also see the information you need to tell other people how to install your bot.
Inviting to Channels
Slack bots have to be invited to channels that they can then participate in. Once you or any of your users have installed your bot, they'll need to use the command "/invite @username" (replace @username with your bot's username) to invite into channels.
Distributing Your Bot
You should use the Slack Button to allow people to install and use your bot with just a few steps.
Slack has a simple code generator on their site to get the code you need to display the button. Choose the app you just created from the list and tick only the Bot option. Then copy the code and paste wherever you want the button to be shown.
Publishing to the Slack App Directory
When you're happy that your bot is working as you expect, you can apply to have the bot listed in the Slack App Directory. Slack has details on their site about how to add an app.
Let us know how we can improve Flow XO on our feedback site.