我的Heroku discord机器人在启动时总是崩溃:
2019-12-15T18:19:00.891355+00:00 app[web.1]: > node index.js
2019-12-15T18:19:00.891356+00:00 app[web.1]:
2019-12-15T18:19:01.076509+00:00 app[web.1]: .-----------------------.
2019-12-15T18:19:01.076512+00:00 app[web.1]: | Command | Load Status |
2019-12-15T18:19:01.076513+00:00 app[web.1]: |---------|-------------|
2019-12-15T18:19:01.076514+00:00 app[web.1]: | help.js | ✅ |
2019-12-15T18:19:01.076515+00:00 app[web.1]: | ban.js | ✅ |
2019-12-15T18:19:01.076516+00:00 app[web.1]: | kick.js | ✅ |
2019-12-15T18:19:01.076520+00:00 app[web.1]: '-----------------------'
2019-12-15T18:19:59.277750+00:00 heroku[web.1]: State changed from starting to crashed
2019-12-15T18:19:59.186024+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2019-12-15T18:19:59.186024+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-12-15T18:19:59.262414+00:00 heroku[web.1]: Process exited with status 22
2019-12-15T18:19:59.202593+00:00 app[web.1]: Error waiting for process to terminate: No child processes
这是怎么回事?它只是在我上传了kick.js文件之后才这样做的(如下所示):
const { getMember, formatDate, moderation } = require("../../functions.js");
const { RichEmbed } = require("discord.js");
const { stripIndents } = require("common-tags");
module.exports = {
name: "kick",
aliases: ["kk", "mod-2"],
category: "moderation",
description: "Kicks A Member",
usage: "< ID or MENTION >",
run: async (client, message, args) => {
if (message.deletable)
message
.delete()
.catch(err =>
message.reply(
"Error Deleting Message! Please Contact @Floofy Boi#7555"
)
);
const user = message.mentions.users.first();
message.channel
.send(
moderation("kick", "test", message.guild.member(user), message.author)
)
.delete(10000)
.catch(err =>
message.reply(
`Error! Here Is The Error: \`\`\`${err}\`\`\`\n\nMake Sure To Notify @Floofy Boi#7555`
)
);
}
};
发布于 2019-12-17 20:51:41
你创建你的Procfile了吗?
如果没有,请在主目录中创建一个名为Procfile
的文件,并将其添加到文件中
worker: node index.js
考虑到主文件是index.js
如果您仍然想使用web dyno,那么在procfile中绑定一个端口
web: node index.js -p $PORT
,其中$PORT
是要绑定的端口
但是我坚持要用worker
,我已经用了快两年了
https://stackoverflow.com/questions/59346853
复制相似问题