How to host your Discord bot 24/7 on an Android Device

like they also have physical access to the servers and get to customize like everything. Basically they buy the hardware themselves

2 Likes

I started to self-host on my phone a few days ago. But theres a lot of latency delays (when the phone is sleeping), and a lot of reconnections.

I turned off battery optimization to keep termux running in the background even the app is not in the app switcher.

1 Like

This method likely isn’t practical, it may just be more of a proof of concept.

1 Like

(Reply to @Nicsena). Somehow I don’t have that problem, my phone is sleeping for almost 12 hours each day, and the bot as no visible delay, and it works 24/7, and I am happy cause I don’t have to pay additional money. Probably because something related to your device or your internet is making the trouble. I don’t really know, but for me it works perfectly. Hosting bot especially on one server shouldn’t be a trouble.

1 Like

If you’re rooted you could probably go way beyond and completely prevent the OS from killing it for whatever reason and start the bot instantly on device restart.

Discord bots are mostly idle and spend much time waiting for events(which you can also ask discord to filter out), it’s mostly just leaving a websocket gateway connection open

Keeping it open in a browser is just additional workload. The more resources you add, you use up more ram or cpu power.

1 Like

if yall don’t care about sharding and music bots, you could try discord.js in the browser :smiley: https://github.com/discordjs/discord.js/blob/master/docs/topics/web.md

4 Likes

Idea💡comes to my life…

1 Like

ok so it keeps saying “module discord.js not found”

Edit: I fixed it

2 Likes

Umm how do I create a command!

You should probably learn discordjs.

1 Like

@ApartSquare3916 You just leaked your bots token, it can be used maliciously by people. Please re-generate your bots token at: https://discord.com/developers/applications

Hey @ApartSquare3916, you leaked your Discord bot token, I’ve flagged it for moderation, would be nice if you removed those images and regenerated your bot token as quickly as possible.

I have regenerated my token can someone Atlest please help me with those errors?

Could you share your code without the token or with a fake token?

Help me how do I make a command it sends errors!!! :frowning:

Maybe tell us the errors

help…