File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 4444 run : export NODE_OPTIONS=--max-old-space-size=6144; npm test
4545 - name : Test building docs
4646 run : export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build
47+ - name : Test building examples
48+ run : |
49+ cd examples/echo-bot-ts
50+ npm run build-sdk
51+ npm install
52+ npm run build
53+ cd -
Original file line number Diff line number Diff line change @@ -28,10 +28,14 @@ const client = new messagingApi.MessagingApiClient(clientConfig);
2828// Create a new Express application.
2929const app : Application = express ( ) ;
3030
31+ const isTextEvent = ( event : any ) : event is webhook . MessageEvent & { message : webhook . TextMessageContent } => {
32+ return event . type === 'message' && event . message && event . message . type === 'text' ;
33+ } ;
34+
3135// Function handler to receive the text.
3236const textEventHandler = async ( event : webhook . Event ) : Promise < MessageAPIResponseBase | undefined > => {
3337 // Process all variables here.
34- if ( event . type !== 'message' || ! event . message || event . message . type !== 'text' ) {
38+ if ( ! isTextEvent ( event ) ) {
3539 return ;
3640 }
3741
You can’t perform that action at this time.
0 commit comments