Created
August 11, 2021 06:22
-
-
Save percybolmer/8c6a5710835f7f7d8a219972af1122a6 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
// 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