-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: sarthakjdev <[email protected]>
- Loading branch information
1 parent
da3632f
commit a335646
Showing
7 changed files
with
27 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ function init() { | |
], | ||
'Help & Support': [ | ||
{ | ||
question: 'Is wapi.js free and open-source?', | ||
question: 'Is wapi.js free and open-source? qwerrqwrf3r3r32r23r23r23r23r2rqrqrerere23re23r23re', | ||
answer: "Yes, it's completely free and open-source under the Apache 2.0 License." | ||
}, | ||
{ | ||
|
@@ -84,7 +84,6 @@ function init() { | |
message: listMessage, | ||
phoneNumber: message.context.from | ||
}) | ||
console.log({ response: JSON.stringify(response) }) | ||
} else { | ||
await message.reply({ | ||
message: new TextMessage({ | ||
|
@@ -103,8 +102,6 @@ function init() { | |
const sectionIndex = parseInt(messageListId.split('-')[1]) - 1 | ||
const questionIndex = parseInt(messageListId.split('-')[3]) - 1 | ||
|
||
console.log({ messageListId, sectionIndex, questionIndex }) | ||
|
||
// @ts-ignore | ||
Check warning on line 105 in packages/example-chat-bot/src/index.ts GitHub Actions / lint-and-build
|
||
const answerToReply = faq[Object.keys(faq)[sectionIndex]][questionIndex].answer | ||
|
||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { z } from "zod"; | ||
import { type z } from "zod"; | ||
import { type Client } from "./index"; | ||
import { | ||
type RequestClientInterface, | ||
type RequestClientConfigOptions, | ||
} from "./interface"; | ||
import { | ||
CloudApiResponseSchemaType, | ||
WapiMessageResponseSchemaType, | ||
type WapiMessageResponseSchemaType, | ||
} from "./schema"; | ||
import { MessageStatusEnum } from "../webhook/type"; | ||
|
||
|
@@ -111,7 +111,9 @@ export class RequestClient implements RequestClientInterface { | |
}; | ||
} | ||
} else { | ||
throw new Error('Failed to parse response, Report to [email protected] urgently. or raise an issue on github.') | ||
throw new Error( | ||
"Failed to parse response, Report to [email protected] urgently. or raise an issue on github.", | ||
); | ||
} | ||
} catch (error) { | ||
if (error instanceof Error) this.client.emit("Error", error); | ||
|
@@ -120,7 +122,7 @@ export class RequestClient implements RequestClientInterface { | |
error: { | ||
title: "Request Error", | ||
description: error instanceof Error ? error.message : "", | ||
errorCode: "", | ||
errorCode: 0, | ||
errorSubCode: "", | ||
}, | ||
}; | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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