I am writing a chatbot using Twisted and wokkel, and everything seems to work, except that the bot logs out periodically. To temporarily establish that I have set access to each initialized connection. Does anyone know how to prevent going offline? (I assume that if I keep sending an available presence every minute or so, the bot will not be disabled, but that seems too wasteful.) Does anyone suggest? Here is the presence code:
class BotPresenceClientProtocol(PresenceClientProtocol):
def connectionInitialized(self):
PresenceClientProtocol.connectionInitialized(self)
self.available(statuses={None: 'Here'})
def subscribeReceived(self, entity):
self.subscribed(entity)
self.available(statuses={None: 'Here'})
def unsubscribeReceived(self, entity):
self.unsubscribed(entity)
Thanks in advance.
source
share