Code:
if (message.author.id !== client.user.id) {
// Use the ChatGPT model to generate a response
openai.completions.create({
engine: 'gpt-3',
prompt: message.content,
max_tokens: 2048,
temperature: 0.5
}, function(error, response) {
if (error) {
console.error(error);
} else {
message.channel.send(response.choices[0].text);
}
});
}
});```
Error:
```TypeError: Cannot read properties of undefined (reading 'create')```