slack-currency

slack command for converting currency

Usage no npm install needed!

<script type="module">
  import slackCurrency from 'https://cdn.skypack.dev/slack-currency';
</script>

README

slack-currency Build Status Coverage Status

slack command for converting currency

slack-currency screenshot example

Running locally

$ git clone git@github.com:matiassingers/slack-currency.git && cd slack-currency
$ npm install
$ npm start

Your local copy should now be running at localhost:1337.

Deploying to Heroku

$ heroku create
$ git push heroku master
$ heroku open

Alternatively, you can deploy your own copy with one click using this button:

Deploy

See the Heroku documentation for more info about changing the configuration variables after deployment.

Slack setup

  1. Create a Slack incoming WebHook integration (settings aren't important, note the WebHook URL)
  2. Deploy your copy of slack-currency, and note your URL endpoint
  3. Create a Slack slash command integration with default settings and use the URL endpoint from above (/currency is recommended, optionally note the token for extra security)
  4. Optional: Add autocomplete help text to Slack command: slack command autocomplete help

Settings

The following environment variables needs to be set for the command to work, if you use the Heroku Button above it'll ask for these automatically.

  • SLACK_HOOK_URL - Slack incoming WebHook URL
  • USERNAME - Username to use when replying with the conversion result (default: dorrars)
  • EMOJI - Emoji icon to use when replying with the conversion result (default: :moneybag:)
  • DEFAULT_CURRENCY - Default currency to convert to if no second currency is specified (default: DKK)
  • SLACK_TOKEN - Additional security step: Slack slash command token for verification that the request came from your Slack team (not required)
  • OPENEXCHANGERATES_APP_ID - Specify a different key for openexchangerates.org in case the already provided key has been revoked (not required)

Related

License

MIT © Matias Singers