/slack_image_cmd

Image search with slack slash command

Primary LanguageGoMIT LicenseMIT

slack_image_cmd

This bot will reply the image URL to the slash command.

Set up

1. Google custom search

2. Slack bot

3. Create slack slash command

  • Create new app and select workspace
  • select "Slash Command"
  • create new slash command
  • select "Basic informaition"
  • get "Verification Token"

4. Environment

  • VERIFICATION_TOKEN: Slack vertification token
  • CUSTOM_SEARCH_KEY: Google custom search api key
  • CUSTOM_SEARCH_ENGINE_ID: Google custom search engine ID

Local build

Execution

  1. installed ngrok
  2. innstalled go v1.10.1

Run

# Start ngrok port 8080 OR other port
$ ngrok 8080
# Start go server
$ go run main.go
# Stop ngrok OR go server
$ ctrl + c