我试过不同的方法,看了看其他所有的回复,但我不知道该怎么做
在启动2022-03-19T09:15:18.022903+00:00herokuweb1:使用SIGKILL2022-03-19T09:15:18.059850+00:00appweb.1:错误等待进程终止:没有子进程2022-03-19T09:15:18.210022+00:00herokuweb.1:状态从状态22 2022-03-19T09:15:18.331083+00:00herokuweb.1:状态从开始更改到崩溃
守则:
require('dotenv').config();
const OpenAI = require('openai-api');
const openai = new OpenAI(process.env.OPENAI_API_KEY);
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
let prompt =`text here`;
client.on("message", function (message) {
if (message.author.bot) return;
prompt += `You: ${message.content}\n`;
(async () => {
const gptResponse = await openai.complete({
engine: 'davinci',
prompt: prompt,
maxTokens: 80,
temperature: 0.7,
topP: 1,
presencePenalty: 0,
frequencyPenalty: 0,
bestOf: 1,
n: 1,
stream: false,
stop: ['\n', '\n\n']
});
message.reply(`${gptResponse.data.choices[0].text.substring(5)}`);
prompt += `${gptResponse.data.choices[0].text}\n`;
})();
});
client.login(process.env.BOT_TOKEN);我的procfile是空的,但是它仍然工作60秒,有什么想法吗?编辑:我尝试过的不起作用的东西,我试着把procfile更改为包含
worker: node index.jsprocfile到worker: java -jar build/libs/*.jar
发布于 2022-03-26 16:40:59
使用名称Procfile而不是procfile,否则heroku就不会知道您需要工作进程,而不是默认的web进程。
https://stackoverflow.com/questions/71536899
复制相似问题