首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >上传新命令后,Discord.js应用程序在启动时不断崩溃

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

Stack Overflow用户
提问于 2019-12-16 02:26:14
回答 1查看 431关注 0票数 0

我的Heroku discord机器人在启动时总是崩溃:

代码语言:javascript
运行
复制
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文件之后才这样做的(如下所示):

代码语言:javascript
运行
复制
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`
        )
      );
  }
};
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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,我已经用了快两年了

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59346853

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档