Cryptocurrency Slack Bot
- It uses the CoinMarketCap API to fetch crypto-currency prices
- It caches a map of "ticker" codes (e.g. "BTC" or "ETH") to their public identifiers
- ... and it uses Cloudflare's cache to minimize the need to hit the API on every invocation, whilst still serving recent price data.
The bot easy to use: ask it for the price of your favorite cryptocurrency!
Ticker symbols and names rely on the currencies listed at CoinMarketCap.
Setting up the bot
Setting up the bot as a Worker in your own Cloudflare account is easy. You'll need a Cloudflare account with Workers enabled (via the "Workers" app in the dashboard).
- Create a Slack app as a slash command
- Create the Worker: copy the contents of
index.jsinto a new Worker script
- Fetch the 'verification token' from your newly created Slack app, and replace the contents of
SLACK_TOKENat the top of your script.
- Create a new route that invokes the Worker (must be HTTPS) - e.g.
- Update the Webhook URL in your Slack app configuration with this URL (minus the *)
- Add the app to your workspace.
BSD 3-Clause licensed. See the LICENSE file for details.