Open accedic opened 5 months ago
I found a work around to do it, but i would like to no have to modify the code for ExponentialBackoff if possible. If theres already a way somewhere in the code which i missed. I would like the module to stay as stock as possible so i deploy this easy without modifying or forking it. Thanks in advance.
Agreed, you shouldn't have to modify ExponentialBackoff in order to disconnect.
I presume you're using the irc.bot.SingleServerIRCBot
. Why not override _on_disconnect
in a subclass? Or you could set your bot's .recon
to a strategy that does nothing:
class DoNotReconnect(ReconnectStrategy):
def run(self, but):
pass
Then when you've decided not to reconnect, set bot.recon = DoNotReconnect()
.
Let me know how that goes.
HI, I see theres a startegy based on disconnect. If it disconnect the bot try's to reconnect. However, in my case i'm using this i want the bot to stop reconnecting if i send it a specific command. How would i go about this? I want it to reconnect when something fails, but not when i want it to stop, as i am starting it in a seperate thread.
Thanks