Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created August 11, 2021 06:51
Show Gist options
  • Save percybolmer/b088c2a92b3d1da0208d6aff084962e8 to your computer and use it in GitHub Desktop.
Save percybolmer/b088c2a92b3d1da0208d6aff084962e8 to your computer and use it in GitHub Desktop.
func handleInteractionEvent(interaction slack.InteractionCallback, client *slack.Client) error {
// This is where we would handle the interaction
// Switch depending on the Type
log.Printf("The action called is: %s\n", interaction.ActionID)
log.Printf("The response was of type: %s\n", interaction.Type)
switch interaction.Type {
case slack.InteractionTypeBlockActions:
// This is a block action, so we need to handle it
for _, action := range interaction.ActionCallback.BlockActions {
log.Printf("%+v", action)
log.Println("Selected option: ", action.SelectedOptions)
}
default:
}
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment