The channel to respond to is also available in the event.Channel. The event does contain the user ID in the event.User so we can use that ID to grab user information. This function will take a *slackevents.AppMentionEvent and a slack.Client as input so it can respond. Once that’s done we will create the handleAppMentionEvent function. ![]() I trust you to make that without guidance now, or go back and read how we did before. We should make the bot respond to the user who mentioned him and if they said hello it should also greet them.īegin by logging into the application and adding the users:read scope to the bot token. ![]() ![]() Now logging the event does not make a fun bot. Import ( "fmt" "os" "time" "/joho/godotenv" "/slack-go/slack" ) func main ( ) Main.go - Use handleEventMessage instead of nesting type switches
0 Comments
Leave a Reply. |