Skip to content
How can I make a discordpy bot update/restart itself without stopping the Flask server
Profile icon

I want to make a command something like [prefix]restart so that my bot doesn't go offline with every little update I make.

You are viewing a single comment. View All
Profile icon

i have an idea run a flask server in one tread: make repl run on start and have that start which makes a flask server then runs it in a thred then start and have the restart command use os.system('python') and then on the newline exit()
so the restart command would look ike this:

import os # -- rest of code-- #restart command os.system('python') exit()

so then the thread is always running but the bot can restart itself

Profile icon

That would cause recursion.

Not a fork bomb, but nested copy's.