Adding new slack apps¶
Adding normal slack apps¶
Visit the slack api console, click the
Create New Appbutton, add the app name (should match the bot name), and select the Slack WorkspaceAdd any necessary collaborators, using the
Collaboratorslink in the sidebar. It’s recommended to keep this list to the set of omnibot admins.Add a bot user, using the
Bot Userslink in the sidebar. Add the display name and username (they should match, and should match the app name). EnableAlways Show My Bot as Online.Add the necessary OAuth scopes, using the
OAuth & Permissionslink in the sidebar. The scopes necessary for the bot depend on the bot’s usage, but a subset of scopes are recommended for every bot:channels:historychannels:readchat:write:botchat:write:usergroups:readim:readmpim:readfiles:readbotreactions:readreactions:writelinks:readlinks:writeusers:readusers:read.email
Install the app, using the
Install Applink in the sidebar. It’s necessary to install this app at this point, so that we can get the credentials for the app.Save the credentials for the application:
From the
OAuth & Permissionslink in the sidebar, save theOAuth Access TokenandBot User OAuth Access Tokenvalues.From the
Basic Informationlink in the sidebar, save theApp IDandVerification Tokenvalues.
At this point you’ll want to add the bot to the omnibot Configuration, then restart the omnibot services. It’s necessary for omnibot to be able to accept events from slack before proceeding.
Add event subscriptions (if the bot needs event subscriptions), using the
Event Subscriptionslink in the sidebar:Add the request URL. This will be the event API route; so, if your omnibot hostname is
omnibot.example.com, the URL would behttps://omnibot.example.com/api/v1/slack/event. Slack will verify the URL, and will only allow you to save if it’s working.You’ll need to decide whether or not a bot should receive workspace events. Workspace events will be sent to the app for any event of this type in the entire workspace, whether or not the bot is a part of the conversation, which likely means the only
messageevent you’ll want to put here ismessage.channels, otherwise you’ll unintentionally send private conversations to the bot. The recommended configuration for most bots is to add the following bot events:message.channels
message.groups
message.im
message.mpim
Add interactive component configuration (if the bot needs interactive components), using the
Interactive Componentslink in the sidebar:Add the request URL. This will be the interactibe API route; so, if your omnibot hostname is
omnibot.example.com, the URL would behttps://omnibot.example.com/api/v1/slack/interactive. Slack will not verify this URL, unfortunately.Add message actions (if the bot will provide message action functionality). The callback used here needs to match an interactive component handler in the omnibot configuration.
(omnibot doesn’t yet support message menus)
Add slash commands (if the bot needs slash commands), using the
Slash Commandslink in the sidebar:Set the command name (
/echofor instance)Set the request URL. This will be the slash_command API route; so, if your omnibot hostname is
omnibot.example.com, the URL would behttps://omnibot.example.com/api/v1/slack/slash_command. Slack will not verify this URL, unfortunately.Set the description.
Set the usage hint.
Ensure
Escape channels, users, and links sent to your appis enabled.
Adding a slack app for use as a primary bot¶
A primary bot is used by the watcher to poll certain APIs in slack for your team and to cache that data for use in parsing. Your primary bot needs a minimum set oauth permissions to correctly poll:
- OAuth scopes required:
channels:readgroups:readim:readmpim:readfiles:readusers:readusers:read.emailemoji:read
Otherwise, setup instructions for a primary bot are the same as a normal bot. Note that your primary bot isn’t limited to this function, and if you want to use it as a normal bot in your slack team, please do so.