Last active
August 11, 2021 06:21
-
-
Save percybolmer/be659f4614ed2aa1a85a72f73091af95 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
// Handle Slash Commands | |
case socketmode.EventTypeSlashCommand: | |
// Just like before, type cast to the correct event type, this time a SlashEvent | |
command, ok := event.Data.(slack.SlashCommand) | |
if !ok { | |
log.Printf("Could not type cast the message to a SlashCommand: %v\n", command) | |
continue | |
} | |
// handleSlashCommand will take care of the command | |
payload, err := handleSlashCommand(command, client) | |
if err != nil { | |
log.Fatal(err) | |
} | |
// Dont forget to acknowledge the request and send the payload | |
// The payload is the response | |
socketClient.Ack(*event.Request, payload) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment