Modification Based on Building Slack Bots in Golang
This project demonstrates how to build a Slackbot in Golang; it uses the slack-go library and communicates with slack using the socket mode.
Create a file /config/config.yaml
with the following variables:
slack:
appToken: "xapp-xxxxxx"
botToken: "xoxb-xxxxxx"
debug: false
chanID: "xxxxxxx"
mysql:
dbUser: xxxx
dbPwd: "xxxxxxxxxxx"
dbHost: xxxxxxxx
dbPort: xxxx // default 3306
dbName: xxxxxxxx
arms:
url: "https://alerts.aliyuncs.com/api/v1/integrations/custom/xxxxxx"
Run the application
go run main.go