Giter Club home page Giter Club logo

Comments (8)

realcoloride avatar realcoloride commented on July 29, 2024 2

Ok, from inspecting it means that fetching the reply failed and since there was no try catch, it errored and stuck your code.

For now you should try catch to avoid making your discord bot. Sorry for the incovenience.

from node_characterai.

Arusu12 avatar Arusu12 commented on July 29, 2024

Wait, just wondering... Is it because of the Guest mode?

from node_characterai.

realcoloride avatar realcoloride commented on July 29, 2024

Hello, can you tell me what is in
at Chat.sendAndAwaitResponse (D:\node_modules\node_characterai\chat.js:71:41)

from node_characterai.

Hexioum avatar Hexioum commented on July 29, 2024

I have the exact same problem. Authenticating with token.

This is in chat.js:71:41
for (let i = 0; i < replies.length; i++) {

When attaching the debugger it says that the response was 'Server Error (500)'

from node_characterai.

Arusu12 avatar Arusu12 commented on July 29, 2024

I have tried direct redirect to the code (using VS Code) but it didn't seem to work. Will let you know after checking it out.

from node_characterai.

Arusu12 avatar Arusu12 commented on July 29, 2024

Yep, as @Hexioum said, the code in chat.js:71:41 is-

for (let i = 0; i < replies.length; i++) {
                messages.push(new Reply(this, response));
            }

Just to let you know, the error happened to me when I tried using authenticate as Guest. It didn't occur ever since I changed to token method.

from node_characterai.

Parking-Master avatar Parking-Master commented on July 29, 2024

replies is clearly undefined. Hence the error - "cannot read property "length" of undefined". What is happening here is the code is running, expecting the AI to generate a response, but runs anyway even know it hasn't responded yet. So here is what I think happened:

  • You're sending too many messages and the AI stops (because of using guest authentication)
  • The for loop must wait until the AI generates a full response (with Promises/await)

from node_characterai.

Parking-Master avatar Parking-Master commented on July 29, 2024

This issue seems to already be fixed though :)

So this issue can be closed

from node_characterai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.