Chatbot using twisted and wokkel

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.

+3
source share
1 answer

XMPP, , , wokkel, , RFC 3921, , (, XMPP , ). , , , , "" " " ( , - , " , , 15 ", , - , , , , ).

+3
source

Source: https://habr.com/ru/post/1743664/


All Articles