Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created August 11, 2021 06:22
Show Gist options
  • Save percybolmer/8c6a5710835f7f7d8a219972af1122a6 to your computer and use it in GitHub Desktop.
Save percybolmer/8c6a5710835f7f7d8a219972af1122a6 to your computer and use it in GitHub Desktop.
// handleSlashCommand will take a slash command and route to the appropriate function
func handleSlashCommand(command slack.SlashCommand, client *slack.Client) (interface{}, error) {
// We need to switch depending on the command
switch command.Command {
case "/hello":
// This was a hello command, so pass it along to the proper function
return nil, handleHelloCommand(command, client)
case "/was-this-article-useful":
return handleIsArticleGood(command, client)
}
return nil, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment