DEBUG_CHATBOT
This commit is contained in:
parent
0918316715
commit
27817789ad
@ -17,6 +17,8 @@ class EcardDownloadConversation extends Conversation
|
||||
|
||||
protected function showEcardMenu()
|
||||
{
|
||||
log_message('error', ('showEcardMenu function called'));
|
||||
|
||||
$chat_session_info = get_chatbot_session_info();
|
||||
$policy_list = ChatbotHelper::getListOfPolicies($chat_session_info);
|
||||
$buttons = [];
|
||||
|
||||
@ -46,9 +46,14 @@ class MainMenuConversation extends Conversation
|
||||
$this->bot->reply($message);
|
||||
}
|
||||
|
||||
log_message('error', ('user_reponse before: ' . $user_reponse));
|
||||
|
||||
|
||||
if (!$answer->isInteractiveMessageReply()) {
|
||||
$user_reponse = null;
|
||||
}
|
||||
|
||||
|
||||
// Get just the existing path array
|
||||
$path = $this->bot->userStorage()->get('path') ?? [];
|
||||
|
||||
@ -60,6 +65,9 @@ class MainMenuConversation extends Conversation
|
||||
'path' => $path
|
||||
]);
|
||||
|
||||
log_message('error', ('user_reponse : ' . $user_reponse));
|
||||
|
||||
|
||||
switch ($user_reponse) {
|
||||
|
||||
case "ecard_download":
|
||||
|
||||
@ -59,7 +59,10 @@ class NetworkHospitalConversation extends Conversation
|
||||
$this->bot->userStorage()->save([
|
||||
'path' => $path
|
||||
]);
|
||||
log_message('error', ('user_reponse : ' . $answer->getValue()));
|
||||
|
||||
switch ($answer->getValue()) {
|
||||
|
||||
case is_string($answer->getValue()) && is_array(explode('#',$answer->getValue())) && count((explode('#',$answer->getValue()))) == 2:
|
||||
|
||||
$client_poilicy_id = explode('#',$answer->getValue())[1];
|
||||
|
||||
@ -46,6 +46,9 @@ class policyConversation extends Conversation
|
||||
if (!$answer->isInteractiveMessageReply()) {
|
||||
$user_reponse = null;
|
||||
}
|
||||
|
||||
log_message('error', ('user_reponse : ' . $answer->getValue()));
|
||||
|
||||
$path = $this->bot->userStorage()->get('path');
|
||||
array_push($path,
|
||||
$answer->getValue()
|
||||
|
||||
@ -89,7 +89,7 @@ class ChatbotControllerNew extends BaseController
|
||||
|
||||
$user = $this->botman->getUser();
|
||||
$id = $user->getId();
|
||||
// $this->myLogger->logme('error', ('TEST' . $id));
|
||||
$this->myLogger->logme('error', ('TEST' . $id));
|
||||
$this->session->set('CHATBOT_RANDOM_USER_ID', $id);
|
||||
}
|
||||
|
||||
@ -128,14 +128,14 @@ class ChatbotControllerNew extends BaseController
|
||||
$this->botman->listen();
|
||||
}
|
||||
|
||||
private function registerHandlers()
|
||||
{
|
||||
// Handling Policy and Claims
|
||||
$this->botman->hears('group:policy:{option}', [\App\Controllers\Chatbot\PolicyHandler::class, 'handle']);
|
||||
$this->botman->hears('group:claim:{option}', [\App\Libraries\Chatbot\ClaimHandler::class, 'handle']);
|
||||
// private function registerHandlers()
|
||||
// {
|
||||
// // Handling Policy and Claims
|
||||
// $this->botman->hears('group:policy:{option}', [\App\Controllers\Chatbot\PolicyHandler::class, 'handle']);
|
||||
// $this->botman->hears('group:claim:{option}', [\App\Libraries\Chatbot\ClaimHandler::class, 'handle']);
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
public function chatbot()
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user