Skip to content

Commit

Permalink
add slash commands api_app_id parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Itai Schwartz committed Oct 13, 2020
1 parent da8fd1f commit 82eb4b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions slash.go
Expand Up @@ -19,6 +19,7 @@ type SlashCommand struct {
Text string `json:"text"`
ResponseURL string `json:"response_url"`
TriggerID string `json:"trigger_id"`
APIAppID string `json:"api_app_id"`
}

// SlashCommandParse will parse the request of the slash command
Expand All @@ -39,6 +40,7 @@ func SlashCommandParse(r *http.Request) (s SlashCommand, err error) {
s.Text = r.PostForm.Get("text")
s.ResponseURL = r.PostForm.Get("response_url")
s.TriggerID = r.PostForm.Get("trigger_id")
s.APIAppID = r.PostForm.Get("api_app_id")
return s, nil
}

Expand Down
2 changes: 2 additions & 0 deletions slash_test.go
Expand Up @@ -33,6 +33,7 @@ func TestSlash_ServeHTTP(t *testing.T) {
"token": []string{"valid"},
"channel_name": []string{"channel"},
"trigger_id": []string{"0000000000.1111111111.222222222222aaaaaaaaaaaaaa"},
"api_app_id": []string{"A123456"},
},
wantParams: SlashCommand{
Command: "/command",
Expand All @@ -48,6 +49,7 @@ func TestSlash_ServeHTTP(t *testing.T) {
Token: "valid",
ChannelName: "channel",
TriggerID: "0000000000.1111111111.222222222222aaaaaaaaaaaaaa",
APIAppID: "A123456",
},
wantStatusCode: http.StatusOK,
},
Expand Down

0 comments on commit 82eb4b4

Please sign in to comment.