Giter VIP home page Giter VIP logo

slack-go-demo-socketmode's Introduction

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.

Working on this project inspired me to write a couple of articles that you can read here or on Medium (* I included friend links so you won't hit Medium Paywall)

Slack Bot Tutorials

Other topics

Test the project

Create a file test_slack.env with the following variables:

SLACK_BOT_TOKEN=xoxb-xxxxxxxxxxx
SLACK_APP_TOKEN=xapp-1-xxxxxxxxx

Run the application

go run main.go

Showcases

  1. Greetings
  2. App Home
  3. Slack commands

Greetings

Tutorial 2 : Properly Welcome Users in Slack with Golang using Socket Mode

App Home

Tutorial 1 : Build Your Slack App Home in Golang Using Socket Mode

Slash Commands

Tutorial 3: Implement Slack Slash Command with Golang using Socket Mode

References

slack-go-demo-socketmode's People

Contributors

xnok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

slack-go-demo-socketmode's Issues

No App Home

I am just starting my journey with Slack programming. Thank you for the tutorial.

There seems to be some things missing, and the commands in the article don't match up with the commands for go, as well as the required items in the app config. That isn't to say that I may be doing something wrong. I am not understanding how to run the examples.

Since I couldn't get it working via the commands in your tutorial, I downloaded the zip file of the repo. I added a test_slack.env file with my appropriate tokens.

When I run main.go from the slack-go-socketmode-main folder, it appears to connect successfully to socket mode (I assume so, becuase I am getting constant messages with socketmode: 2021/07/06 11:25:37 socket_mode_managed_conn.go:561: WebSocket ping message received: Ping from applink-canary-5467cdc868-t2smp).

When I go to the app home page in Slack, it never creates the page (I get a message that this is still a work in progress). Now I am at a loss as to where to proceed.

Thanks in advance...

errors while running the code

Hi,

I get the following errors while running the code:

controllers/appHomeController.go:15:16: undefined: socketmode.SocketmodeHandler
controllers/appHomeController.go:18:41: undefined: socketmode.SocketmodeHandler
controllers/appHomeController.go:55:15: clt.GetApiClient undefined (type *socketmode.Client has no field or method GetApiClient)
controllers/appHomeController.go:74:15: clt.GetApiClient undefined (type *socketmode.Client has no field or method GetApiClient)
controllers/appHomeController.go:102:15: clt.GetApiClient undefined (type *socketmode.Client has no field or method GetApiClient)
controllers/greetingController.go:14:16: undefined: socketmode.SocketmodeHandler
controllers/greetingController.go:17:42: undefined: socketmode.SocketmodeHandler
controllers/greetingController.go:49:22: clt.GetApiClient undefined (type *socketmode.Client has no field or method GetApiClient)
controllers/greetingController.go:60:14: clt.GetApiClient undefined (type *socketmode.Client has no field or method GetApiClient)
controllers/greetingController.go:83:22: clt.GetApiClient undefined (type *socketmode.Client has no field or method GetApiClient)
controllers/greetingController.go:83:22: too many errors

pls also notice that there is an error in go.mod as it refers to local path (i guess it should be fixed to:
replace github.com/slack-go/slack => github.com/xnok/slack v0.8.0)

ERROR publishHomeTabView due to empty evt_app_home_opened

Hi,

I'm getting:
ERROR publishHomeTabView: received empty parameters

because evt_app_home_opened.User is empty. When I'm trying to print evt_app_home_opened it seems like all the fields are empty:
{ {{false { [] []}} <nil> <nil> <nil> {[]} <nil> false false }}

any advice?
thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.