【发布时间】:2020-04-08 08:09:18
【问题描述】:
我的 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`
)
);
}
};
【问题讨论】:
标签: node.js heroku discord discord.js