File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
functions/slack_slash_command Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 22 "require" : {
33 "google/cloud-functions-framework" : " ^0.6" ,
44 "google/apiclient" : " ^2.8"
5+ },
6+ "scripts" : {
7+ "post-update-cmd" : " Google\\ Task\\ Composer::cleanup"
8+ },
9+ "extra" : {
10+ "google/apiclient-services" : [
11+ " Kgsearch"
12+ ]
513 }
614}
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ function isValidSlackWebhook(ServerRequestInterface $request): bool
4747
4848 // Compute signature
4949 $ plaintext = 'v0: ' . $ timestamp . ': ' . (string ) $ request ->getBody ();
50- //var_dump($plaintext);
5150 $ hash = 'v0= ' . hash_hmac ('sha256 ' , $ plaintext , $ SLACK_SECRET );
5251
5352 return $ hash === $ signature ;
@@ -109,7 +108,6 @@ function formatSlackMessage($kgResponse, $query): string
109108*/
110109function searchKnowledgeGraph ($ query ): Google_Service_Kgsearch_SearchResponse
111110{
112-
113111 /**
114112 * PHP Functions Framework does not support "global"/instance-scoped
115113 * constants, so we fetch these values within PHP functions themselves.
@@ -135,7 +133,6 @@ function searchKnowledgeGraph($query): Google_Service_Kgsearch_SearchResponse
135133*/
136134function receiveRequest (ServerRequestInterface $ request ): ResponseInterface
137135{
138-
139136 // Validate request
140137 if ($ request ->getMethod () !== 'POST ' ) {
141138 // [] = empty headers
You can’t perform that action at this time.
0 commit comments