Getting chatbot’s last message
-
function start_ticket_thread($reply, $query) { // First we'll check if the user is asking to create a ticket. $last_message = $query->get_message(); $expected_question = 'Create a ticket to support.'; if ($last_message == $expected_question) { $reply->set_reply('Please start the reply with (NEW_TICKET) followed by the subject title, subject type (general/technical) and a description.'); } return $reply; } add_filter('mwai_ai_reply', 'new_ticket_reply', 10, 2);Hello I have this code to set a custom reply to a user when he wants to send a ticket to support using the chatbot and I want to make another filter which checks whether the last message returned by the chatbot is “Please start the reply with (NEW_TICKET) followed by the subject title, subject type (general/technical) and a description.”, may I know how do I do this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Getting chatbot’s last message’ is closed to new replies.