#Discord Bot does not remember chats

17 messages · Page 1 of 1 (latest)

sick minnow
#

Hey, my bot has the function to create threads in which the bot can chat with the members. It can also save things which were said in the conversation. But whenever the bot restarts, it can no longer save any information that is said in the chats in threads that were created before the restart. Only when you press the button again and create a new thread can he save information in chats again. Whats the problem with the code?

delicate vault
#

The bot loses its knowledge of the channel and information about who it was chatting with and the history when it restarts (the memory space resets), to persist these things, you can look into something called pickle

#

you can pickle the conversation history and data and then load it on startup

sick minnow
#

But this only if the bot restarts in old already existing threads

#

Example:

Max: Hello!

Bot: Hello, how can I help you today

Max: My name is Max!

Bot: Hello Max, how can I help you today?

Max: Say my name!

Bot: As an AI Model, I have no knowledge about you and your name.....

delicate vault
#

The issue is still what I said, the conversation history is lost from the memory, you need to load it again into the prompt or messages array

#

You need to store the conversation history periodically or on a bot stop event with pickle and then load the pickles that were saved on bot startup

sick minnow
#

But it has nothing to do with the chats before the reset, right?

#

The bot should lose all the memory it had before restart, its not the problem

#

But it should not lose his ability to chat and saving information while a conversation

#

And he only does that when a thread is already existing

#

But not when a new one is created

#

Even after a restart

#

It's really strange

sick minnow
#

@delicate vault