Submit to chatbot programmatically

This topic is: resolved

 

Thank you for contacting me. Please note that I live in the GMT+3 time zone - responses might be delayed by this.

This topic has 7 replies, 3 voices, and was last updated 1 year, 2 months ago by stefanokun.

Viewing 7 reply threads
  • Author
    Posts
    • #8606


      stefanokun
      Participant
      Post count: 9

      How to submit the chatbot prompt programmatically with Javascript without the need to click the submit button?

      For example, when I paste some text “how are you?” into the prompt field, the content should be submitted automatically just like when I click the submit button.

      I was able to do that with a similar plugin and I wonder if there’s a way with yours.

    • #8607


      Szabi – CodeRevolution
      Keymaster
      Post count: 4577

      Hello,

      Yes, this is possible. After you pasted the text in the input field, you need to call the following JS function:

      openaichatfunct();

      Regards, Szabi – CodeRevolution.

    • #8610


      stefanokun
      Participant
      Post count: 9

      Great, thanks.

      You might want to produce documentation with all the cool things that can be done with some code.

    • #8611


      stefanokun
      Participant
      Post count: 9

      Can I submit a message by argument like openaichatfunct(‘Hello how are you’); ?

    • #8612


      Support CodeRevolution
      Moderator
      Post count: 2

      No, currently adding a message in the argument is not possible, for this, a customization would be needed.

    • #8614


      stefanokun
      Participant
      Post count: 9

      That’s too bad.

      The code below only works on the first message, then an empty message is sent and the bot answers to its own last message.

      document.getElementById(“aiomatic_chat_input”).innerText = transcript;
      openaichatfunct();

      Screenshot attached.

       

      Attachments:
      You must be logged in to view attached files.
    • #8618


      Szabi – CodeRevolution
      Keymaster
      Post count: 4577

      Not correct, you need to do instead:

      document.getElementById(“aiomatic_chat_input”).value= transcript;
      openaichatfunct();

    • #8626


      stefanokun
      Participant
      Post count: 9

      Great, thanks

Viewing 7 reply threads

The topic ‘Submit to chatbot programmatically’ is closed to new replies.