koishijs / chatgpt-bot

AI conversation based on ChatGPT | 基于 ChatGPT 的 AI 对话机器人
https://chatgpt.koishi.chat
MIT License
70 stars 13 forks source link

Feat: store conversation in database instead of in-memory map object #12

Open purerosefallen opened 1 year ago

purerosefallen commented 1 year ago

To make conversations survive between Koishi restarts, it could be better to store the conversation IDs into database instead of a memory map.

MaikoTan commented 1 year ago

Maybe we should also consider instances that has no database enabled, how to deal with them?

Can you provide some minimal example or workaround?

purerosefallen commented 1 year ago

You may use .userFields to observe user, and do the talk. if user does not exist, fallback to the map thing. Plus, if you think instances without database should be considered, so do other plugins such as github, or teach.

purerosefallen commented 1 year ago

Now that Cache API being a thing, how about that one?

MaikoTan commented 1 year ago

I'll take a look when I have time.

Merci pour votre information !