This is the slack bot that responds to the /lookup
commands in your Slack instance.
You can try a publically available Lookup or when logged into your Twilio Console
+----------------------+ +---------------------------+
| | | |
| Slack Bot/App +-----------------> | Twilio Function |
| | | |
| (runs in Slack] | | (function.js) |
| | <---------------+ | |
+----------------------+ +---------------------------+
- Enable Add-ons in the Console
- Make sure you filter the list by the Lookup Category
- Take note of the unique name for each enabled add-on.
- Update the list of add-ons at the top of the function.js file.
- Setup a https://www.twilio.com/console/runtime/functions/manage with the code in function.js
- Turn off signature validation inside your function
- Enable ACCOUNT_SID and AUTH_TOKEN here: https://www.twilio.com/console/runtime/functions/configure
- Browse to api.slack.com and login.
- Create a new Slack App. Name the app and select your development Slack workspace.
- Open the newly created app.
- Browse to: Basic Information -> Add Features and Functionality
- Interactive Components -> Add the Twilio Function URL as the
Request URL
. Save Changes.
- Interactive Components -> Add the Twilio Function URL as the
- Browse to: Basic Information -> Slash Commands (e.g.
/lookup
). - Browse to Install App to install it in your workspace.
- Create LOOKUP_SLACKBOT_TOKEN env variable here: https://www.twilio.com/console/runtime/functions/configure
- Set LOOKUP_SLACKBOT_TOKEN to the Verification Token from your Slackbot's Settings -> Basic Information -> App Credentials -> Verfification Token
- Browse down, Save Changes.
- Wait a few minutes. Perhaps restart Slack.
- Simply type
/lookup 12024561414
- Select different enabled Lookup addons from the dropdown for additional information