Giter Site home page Giter Site logo

discord.js-heroku's People

Contributors

synicalsyntax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

discord.js-heroku's Issues

Disable sleep, don't work around it.

Instead of

setInterval(() => {
 http.get('http://discordjs-heroku.herokuapp.com');
}, 900000);

Just change the text in the Procfile to

BOT: node index.js

And DISABLE the WEB Dyno on heroku, and ENABLE the BOT Dyno on heroku.
Using the npm start script and having the WEB Dyno enabled will tell heroku it is a website and that it can sleep.

This is the official way to disable sleeping and wont use excess resources loading the website every 15 mins.

bot

the bot keeps leaving the vc whenever i request a song because of the code
what do i do

Remove Express Server & Sleep Workaround

You have a bit of code that refreshes the web worker to keep the app awake, but if you had read the heroku docs, you would know that if you disable the web worker, put a custom name in the procfile and a custom start command, it will naturally not sleep.

Heroku only sleeps apps because its default action is for web hosting, which doesn't need to be awake 24/7.
But if you disable that and use a custom worker it will stay up 24/7 until you run out of hours.

In fact by doing this you are using more resources hosting the web dyno and connecting to it.

PR Incoming

Error R10

Hello, after launching my heroku app it's giving me this log:
2018-04-06T11:46:07.785538+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-04-06T11:46:07.785690+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-04-06T11:46:07.918173+00:00 heroku[web.1]: State changed from starting to crashed
2018-04-06T11:46:07.899719+00:00 heroku[web.1]: Process exited with status 137

Is there a way to fix this?

Bot shutsdown after 60 seconds

2018-09-23T08:14:48.963688+00:00 heroku[web.1]: State changed from crashed to starting
2018-09-23T08:14:52.000000+00:00 app[api]: Build succeeded
2018-09-23T08:14:54.586216+00:00 heroku[web.1]: Starting process with command `npm start`
2018-09-23T08:14:57.743158+00:00 app[web.1]: 
2018-09-23T08:14:57.743175+00:00 app[web.1]: > [email protected] start /app
2018-09-23T08:14:57.743176+00:00 app[web.1]: > node index.js
2018-09-23T08:14:57.743178+00:00 app[web.1]: 
2018-09-23T08:14:59.914132+00:00 app[web.1]: AUIB system online
2018-09-23T08:14:59.915952+00:00 app[web.1]: Found guild: Another Chance
2018-09-23T08:14:59.918248+00:00 app[web.1]: Found guild: /r/SpaceboyRoss
2018-09-23T08:15:55.143852+00:00 heroku[web.1]: State changed from starting to crashed
2018-09-23T08:15:55.005857+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-09-23T08:15:55.005857+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-09-23T08:15:55.125602+00:00 heroku[web.1]: Process exited with status 137

cannot find module discord.js

Hello,

I have followed your tutorial and the deploy works fine but when the app run it says the discord.js module could not be found. Seens like the server is not running npm install before npm start.

Here is my package.json

{
  "name": "reign-bdo-discord-bot",
  "version": "0.0.1",
  "requires": true,
  "lockfileVersion": 1,
  "engines": {
    "node": "8.x",
    "npm": "*"
  },
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node app.js"
  },
  "author": "ygordanniel",
  "license": "MIT",
  "dependencies": {
    "async-limiter": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
      "integrity": "sha1-ePrtjD0HSrgfIrTphdeehzj3IPg="
    },
    "discord.js": {
      "version": "11.3.0",
      "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-11.3.0.tgz",
      "integrity": "sha1-DT4q4ShG5OACvb3+PLJl4r8kvzI=",
      "requires": {
        "long": "3.2.0",
        "prism-media": "0.0.1",
        "snekfetch": "3.6.4",
        "tweetnacl": "1.0.0",
        "ws": "4.0.0"
      }
    },
    "long": {
      "version": "3.2.0",
      "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
      "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s="
    },
    "moment": {
      "version": "2.20.1",
      "resolved": "https://registry.npmjs.org/moment/-/moment-2.20.1.tgz",
      "integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg=="
    },
    "prism-media": {
      "version": "0.0.1",
      "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-0.0.1.tgz",
      "integrity": "sha1-o0JcnKvVDRxsAuVDlBoRiVZnvRA="
    },
    "safe-buffer": {
      "version": "5.1.1",
      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
      "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM="
    },
    "snekfetch": {
      "version": "3.6.4",
      "resolved": "https://registry.npmjs.org/snekfetch/-/snekfetch-3.6.4.tgz",
      "integrity": "sha1-0T6AphbYkvPTjarkKJ9NJYpkUSA="
    },
    "tweetnacl": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz",
      "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins="
    },
    "ultron": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
      "integrity": "sha1-n+FTahCmZKZSZqHjzPhf02MCvJw="
    },
    "ws": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/ws/-/ws-4.0.0.tgz",
      "integrity": "sha1-v+HaTAjuuXgLmG4OTRDszXNFmZ8=",
      "requires": {
        "async-limiter": "1.0.0",
        "safe-buffer": "5.1.1",
        "ultron": "1.1.1"
      }
    }
  }
}

Let me know if you need more information.

Change the default branch

Hey!
This guide has really helped me, so thanks for doing it!
Even that, I faced a problem: GitHub recently changed the default branch from master to main, but your guide still says master. I think it could be a good idea to change "master" to "main" or, at least, advice both possibilities.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.