Categorygithub.com/Clint-Mathews/slack-file-bot
repositorypackage
0.0.0-20220331045534-6d56b4dd5891
Repository: https://github.com/clint-mathews/slack-file-bot.git
Documentation: pkg.go.dev

# README

slack-file-bot

Slack bot to upload files to channel

TO RUN/BUILD APP

To Build the app:  go build
To run the application : go run main.go

On running the app you'll get the file uploaded in channel
image

Technical Dependencies:

  • Using godotenv for getting .env configs
  • Using slack-go for connecting and uploading files
  • To install godotenv: go get github.com/joho/godotenv
  • To install slack-go : go get "github.com/slack-go/slack"
  • The application requires slack SLACK_BOT_TOKEN & CHANNEL_ID in the .env file, so create the .env file on root
  • To get those credentials you'll need a slack account with a work space and you'll need to be the admin of that workspace
  • Create a bot from scratch, give the nessecery permissions, enable socket mode and install the bot to workspace
  • You'll then recive the bot token from "Oath and Permisions" tab when you install to workspace
  • You can find the channel if you select "Open channel details" on right click of channel and its to the extreme end
  • Add the files you want to upload in root folder and mention the file names in fileArr