Best way to automatically reconnect #211
Replies: 3 comments 2 replies
-
Hey Alpinefresh! You can attempt to trigger one of the callbacks in a timed loop to check if the bot is online, and have it try to log in again if its not online. Basically just "refreshing" every few minutes. If your bots are highly active (frequently receiving group/private messages), you can reduce downtime by listening for ALL callbacks and having it only trigger "refreshing" if none of them have been triggered within a shorter timespan, like 1-2 minutes. Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Make an automation script to restart your bot every 10-15 mins. It doesn't require an internet connection or anything so your bot getting disconnected won't be a problem. If you've frequent internet issues then adjust the time in which the bot restarts to like 5 mins, and your bot script will auto-execute every 5 mins.
|
Beta Was this translation helpful? Give feedback.
-
Within the main bot project class I use the on_disconnect(self) function to count disconnects.
Then at the end of my code where main() and is called, I have this:
This seems to work fine. Also I send the stanza |
Beta Was this translation helpful? Give feedback.
-
Hi
I'm trying to work out the best way to automatically reconnect if the connection to kik is lost. I'm struggling to work out how to do this safely - any pointers?
Beta Was this translation helpful? Give feedback.
All reactions