Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
How do I make "msg.content" constantly get new strings added to it instead of replaced?
 var collector = new MessageCollector(message.channel, filter, {
    max: 10,
    time: 60000,
})

        collector.on("collect", (msg) => {
            console.log(msg.content)
            
        openai.Completion.create({
            
            engine: "davinci",
            prompt: msg.content,
            temperature: 0.9,
            max_tokens: 150,
            top_p: 1,
            frequency_penalty: 0.35,
            presence_penalty: 0.6, 
            stop: ["\n", " Human:", " AI:"]  
        
        }).then((response) => {
            
            message.channel.send(response.choices[0].text)
        })

    })
}

So I was trying to implement the AI "GPT-3" into a discord bot to see how it would work, but GPT-3 needs to know the prompt (basically context of a conversation) all the time. With the way I have it set up, it constantly replaces the variable (msg.content) with new strings once they are grabbed by "MessageCollector". I need to make it so that whenever a message is detected, it adds that string to the variable and constantly doing that until, lets say a timer goes off.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda