0

I have a telegram bot and I need to update it without stopping it.

Something like uvicorn when we were running an app. ( uvirorn filename:appname --reload )


I need such a thing for pyrogram.
from pyrogram import Client

app = Client(...)

@app.on_message()
def OnMessage(client, message):
    ... # I change this section's code. And I want it to apply without stopping code.

app.run()

I used the reloading module, but it didn't work. If you know a solution or module for this, please share it with me.

S. Jacson
  • 33
  • 6
  • 1
    Nope. You can force a module to reload. You can't force the main program to reload. You can wrap the app in a shell script with an infinite loop, so any time the script exits it gets restarted, but the instance has to exit. – Tim Roberts Feb 27 '23 at 18:42

0 Answers0