discord-gpt-bot/bot/memory.go

16 lines
279 B
Go

package bot
import (
"discord-gpt-bot/openai"
)
var conversations = map[string][]openai.Message{}
func GetHistory(userID string) []openai.Message {
return conversations[userID]
}
func SetHistory(userID string, history []openai.Message) {
conversations[userID] = history
}