Created
August 11, 2021 06:51
-
-
Save percybolmer/b088c2a92b3d1da0208d6aff084962e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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