https://github.com/gesteves/alexa-slack
An Alexa skill to manage status and notifications in Slack. Alexa, tell Slack I'm out for lunch until 3:00 pm.
https://github.com/gesteves/alexa-slack
alexa-skill aws-lambda javascript nodejs slack
Last synced: about 1 month ago
JSON representation
An Alexa skill to manage status and notifications in Slack. Alexa, tell Slack I'm out for lunch until 3:00 pm.
- Host: GitHub
- URL: https://github.com/gesteves/alexa-slack
- Owner: gesteves
- Created: 2017-06-07T22:17:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-01T22:10:45.000Z (about 8 years ago)
- Last Synced: 2025-04-12T17:48:58.090Z (6 months ago)
- Topics: alexa-skill, aws-lambda, javascript, nodejs, slack
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 17
- Watchers: 0
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Alexa Slack
Alexa skill to set status and manage notifications in Slack, built in Node and hosted on AWS Lambda.
## Supported commands
* "Alexa, tell Slack I'm `status` until `time`", sets the status message to the spoken status _and_ mutes Slack notifications until the spoken time (e.g. 3:15 pm, this afternoon, etc.) Super useful for meetings! For example, "tell Slack I'm in a call until 5:00 pm".
* "Alexa, tell Slack to clear my status", clears your status and un-mutes notifications.## Installation
I can't release this on the Alexa Skills store because I don't have the right to use "Slack" as the invocation name for a public skill, but feel free to fork this repo and set it up as your own skill in development mode for private use. It'll take a bit of work, but you'll have to:
* Set up a new [Slack app](https://api.slack.com/apps), with the `dnd:read`, `dnd:write`, and `users.profile:write` permission scopes.
* Set up an [Alexa Skills Kit skill](https://developer.amazon.com/edw/home.html#/skills). Use the code in `interaction_model.json` for the skill's interaction model.
* Set up a project in the [Google Developer Console](https://console.developers.google.com). Enable the Google Maps Geocoding API and the Google Maps Time Zone API, and get an API key. (This is how we determine the user's time zone: get the postal code of the Echo, geocode it to a lat/long pair, then get the timezone offset of those coordinates. I wish Amazon made this easier.)
* In the configuration tab, set up [account linking](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system) using your Slack app's OAuth information. (Pro tip: the "Client Authentication Scheme" option should be "Credentials in request body").
* Also in the configuration tab, check the option to request permission to use "Device Address", specifically the device's postal code & country.
* Set up an [AWS Lambda function](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/developing-an-alexa-skill-as-a-lambda-function) for your Alexa skill. You'll need to set up an `ALEXA_APP_ID` environment variable with your skill's ID; and a `MAPS_API_KEY` env variable with the Google Maps API key you got earlier.
* Clone/fork this repo, run `npm install`, then zip up `index.js`, `package.json`, and the `node_modules` folder, and upload to your Lambda function.
* Enable your skill for testing, then enable it in your Alexa app in your phone. Make sure your Echo has an address set up, and give the skill permission to access it. It should prompt you to sign in with Slack to link your account. If it successfully links your account, you're set!