A slack bot to upload files made using Golang
Setting up everything and testing the bot:
- On slack api, go to OAuth and Permissions and add various scopes like channel read, chat write, file read and write, im read and write, remote files read write share etc.
- Create a new channel or choose from existing channels and get the channel id.
- Also get the Bot User auth token.
- Install the package “github.com/slack-go/slack” using “go get github.com/slack-go/slack” command.
- Verify if packages are fine using “go mod tidy”.
- Run “go mod init “github.com/your-user-name/slack-file-bot”.
- Run the main.go file by altering the file path. (“go run main.go”)
Below is a test result of “Test.txt” uploaded by the file bot.
Further Plans:
- Add option to give file name from command line.
- Add an interface.