How to host Discord Bot 24/7 on an IOS device!

Intro: (THIS MAY BE UPDATED SOON)

  1. This is based on this thread by @JavaScript!
  2. As most of us know that Glitch permanently banned all pinging services and everything related to them. Most of us also can’t afford buying a Glitch subscription or using other services. There is a great solution that you can do on an old iphone or ipad!
    What You Will Need:
  • IOS Device- if you have an android device check out this thread

  • Internet access

  • Testflight and ISH app

  • Code editor: Not needed, you can just edit files in github.

Step by Step Directions:

1.If you use vscode, write your files in there, if you don’t go to github

  1. Create a file named index.js

  2. Write your bot code or use this example bot I made.

  3. Save and close the file. If you used vscode, then upload your bot to github.

  4. Click here to download the testflight app.

  5. Once downloaded, click here to download the ISH app

  6. Once you have ish, run the command: apk add npm

  7. Run the npm i node.js command

  8. Run the command git clone github.com/[USERNAMEHERE]/[YOUR_GITHUB_REPO_NAME] to import your files

Lets start the bot!
Run node index.js or a npm start

How long my bot will run for?
The bot will run 24/7 unless your device runs out of the battery or once you lose the internet connection. To keep your ios device from falling asleep, go to settings > Display & Brightness > Auto-Lock > Never

How much RAM, MEMORY, and CPU my bot will have?
This all depends on your device and internet. The better device is, the better your bot hosting is.

If you have any questions, feel free to ask one :slightly_smiling_face:

6 Likes

Or just use Github and Heroku. Similar setup but add a file named Procfile and the code in it is

worker: node index.js
1 Like

Heroku doesn’t have enough hours to keep your bot online 24/7

And also don’t you need to put in a credit card?

1 Like

For custom domains, I believe.

This method may not work as iOS will kill any applications using too much ram or running at background for a long time.

Yeah, ElectricReality is right. iOS killed a python script (pagekite) after running in the background after 2-3 minutes.

Wait really??? It will still kill if: To keep your ios device from falling asleep, go to settings > Display & Brightness > Auto-Lock > Never

I don’t think keeping the display always on will prevent iOS from killing scripts and applications using too much RAM.

I probably wouldn’t do this, even if you have it plugged in, this will probably still drain the battery and limit the percentage the battery can go to, a problem already common with iOS devices.

That happens with all devices, not just iOS or iPadOS ones.

Maybe you could turn the brightness down?

It’s not about the screen, it’s about the device being used 24/7

Your device is used (by system, apps and etc…) 24/7 anyways, it’s just the usage not being that extreme. I mean, Termux (running my bot) consumes 25% of my battery every 8 hours, it isn’t that bad, it could’ve been worse :joy:.

Guys, please note that node is very buggy on iSH right now.

Yep! Its node branch was just released a couple of days ago.

Oh really :joy: ! Maybe use another terminal app then lol

not much else for ios

or is there
see:

cat /dev/location > /dev/null &

will keep the bot online and make ios not kill it for being in background too long.

2 Likes