上传新命令后,HEROKU Discord.js应用程序在启动时不断崩溃

时间:2019-12-15 18:26:14

标签: node.js heroku discord discord.js

https://i.stack.imgur.com/71POG.png

如上面的图像和下面的代码块所示,我的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`
        )
      );
  }
};

请你帮我

1 个答案:

答案 0 :(得分:0)

您是否创建了Procfile?

如果未在主目录中创建名为Procfile的文件, 将此添加到文件中

worker: node index.js

考虑主文件是index.js

如果您仍然想使用Web dyno,请在procfile中绑定端口

web: node index.js -p $PORT $PORT是您要绑定的端口

但是我坚持使用worker,因为现在XD我已经用了将近2年了