Heroku Bot Stops after 24 hours - heroku

I have a small Discord.js reactions bot that gives roles to the members. It runs fine for 24 hours then it stops... if I refresh the bot with a code it starts working again.
It’s very annoying as I want it to run all the time and not require me to log on every day to manually refresh it.
It is hosted with Heroku if that helps.

Heroku dynos restart one or few times in a day, that's how Heroku's free hosting works. If you lose your reactions use Data base as jonrsharpe said. The easiest to use is MongoDB and there is a lot of tutorials on how to make a reaction role system with it, hope my answer helped!

Related

From what IP and fingerprint do Reddit bots deployed on Heroku (or equivalent) work?

I'm planning on using bots to moderate my Reddit servers. I own a bunch of them, and some of them have grown pretty rapidly and unexpectedly in a short period of time, so I think it's time I start automating parts of the moderation.
One of the options I'm considering is deploying a python script on Heroku or Dokku, and just leave that runnning.
What I would like to know is what exact location/IP address will reddit see the bot user logged in as. I will be having 5-10 bots, and I want to make sure I am not breaking any rules.
A long time ago I experimented with using selenium bots on Reddit, however Reddit has very strict policy with selenium bots, and all the accounts either got banned or shadowbanned.
I was doing somewhat spammy things with my selenium bots, however I plan on using these bots strictly for moderation purposes, and I'd like to know what precautions I'd need to take to avoid bans/shadowbans.
Also, do I need to use a different Heroku location for each bot? I remember using a multi-fingerprint browser with different proxies for my selenium bots.
Any help would be appreciated,
Thanks!

Heroku alternative

I´m new on development and found Heroku easy for deploying my app.
I was happy until I got to problems:
Heroku does not provide an IP adress which I need for a white IP list to access an API. I fixed this with a Heroku add-on proxy called Fixie. That is free if under 500 request per month.
The Heroku free plan sleeps after 30 min of inactivity. My app needs to makes API requests at midnight and this is getting difficult because the app is sleeping.
I was thinking to pay the nearest cheap plan on Heroku which make that the app does not sleep. But then I though why not use another platfrom than Heroku.
Does anyone have some sugestions? Any other platform that give an IP so I don´t worry about crossing the 500 request per month?
I was thinking of AWS Elastic Beanstalk. But as I said I´m new at this.
You can use DigitalOcean: the cheapest plan is 5$ a month and you get a Droplet with its own IP address. The Droplet is always running (no inactivity timeout like Heroku).
The main difference is Heroku provides an abstraction layer on top of the underlying infrastructure (you only deal with the application deployment and management) while DigitalOcean delivers a virtual box (ie Ubuntu), however the documentation is great and you can easily find what you need (ie install Docker, etc..)
Couldn’t agree more.
I have been running many applications on Heroku for years now and have faced the 1st problem that you’ve mentioned multiple times.
I tried using Engine Yard instead of Heroku as far as I can remember I never faced the IP issue that you are referring to. AWS is good, but again it’s not without its limitations because its really hard to use. It’s these shortcomings that drive users crazy, isn't it? All I can say is that when I shifted to Engine Yard the set problems I faced considerably dropped. It appears to be a much more usable platform. Check it out.
Here’s a link to Engine Yard, which I hope will help you.

I use Quick.db in my Discord bot. Every time I deploy an update the db does not save, why is this and how do I fix it?

So... I use quick.db for my Discord bot's Economy System. It's all perfectly set up however every time I deploy an another update for my Discord bot from Github, the db does not save, and everyone's stats across everyone's server reset back to 0, why is this? Someone told me that it's because Heroku doesn't save "persistent" data, but I have hopes for a solution. Please let me know if there is any way to resolve this, and what the problem is, many thanks in advance.
That's because Heroku Dyno Storage is "Ephemeral" which means that every day the db will be reset because it is taken again from your github or from where it's deploying

Adding the billing card to the Heroku account and cons/pros of using dynos

Since I am not very familiar with Heroku I need opinion of a specialists like you. I got two questions to which I cannot find an answers on the web.
Heroku tempts with the 450 dynos if I add the billing card.
Is that secure to add it?
Will they take the money from my account without my permission? If for instance I have used all the dynos, would they take the money from my account to add some dynos?
Do dynos last for long? How many users can use my site if I got 1000 dynos?
I tried to understand the answers from the another questions here in stack, but I could not understand them.
Please do not use the technical language, try to answer these questions as simply as you can (for me and users who will read it).
This is a very vague question, so I'll do my best to answer it clearly.
Adding your credit card to Heroku is perfectly safe. They are a legitimate company.
Heroku will automatically charge your credit card at the end of the month if you go OVER their free tier, meaning you use more than 450 dyno hours across your Heroku account, or if you provision paid addon services.
Dynos last forever, until you remove them. Heroku allows you to add dynos, remove them, etc., all instantly.
You also asked how many users your site can support if you have 1,000 dynos: this is equivalent to asking how many users your site can support if you have 1000 web servers. This is dependent on many factors: what does your site do? How was your site built? Etc.. In general, most webapps on Heroku only require 1 dyno to run indefinitely.

Azure/SSL works in staging kills roles in production

I generated a self-signed cert, exported and uploaded to the subscription. When I deploy to staging, all works well when I navigate to the app (MVC) it redirects to https appropriately, I get the warning but all works perfect when I continue to the site. When I deploy same package to production, none of my roles responds, to web requests or tcp, I can't even RDP into the VMs.
Any ideas?
EDIT: I'm going to say this is closed. I gave it an hour (watched tv to clear my head).. and it started functioning correctly. Perhaps it just took an extra long time to spin up the VMs.
Some time it take longer then expected for the role to start and if you are interested to know why I have explained in the following SO question:
Is there a way to reduce time between Azure deployment start and role OnStart() code being invoked?
Want to know more let me know and I would love to explain in much finer details.

Resources