Closed learningpythons closed 1 year ago
You need to understand why the bot stops listening for events. Try to enable DEBUG
logs if you haven't already done so and see if there any connection related logs.
I turned on the debugger but there is no output.
Every 2 minutes I call...
self.client.send_stanza("< ping / >")
(no spaces between quotes) ...and now doesn't disconnect even if no communication with bot in gc or dm
Every 2 minutes I call...
self.client.send_stanza("< ping / >")
(no spaces between quotes) ...and now doesn't disconnect even if no communication with bot in gc or dm
Send_stanza is just for auth, it doesn't take args like that. Also the function is in auth_stanza not client anyways. There's your issue i guess, ping it with a callback instead.
Modified my client.py
def send_stanza(self, XMPP_msg) stanza = XMPP_msg.encode()
self.loop.call_soon_threadsafe(
self.connection.send_raw_data, stanza)
Know it def works because when set logging.DEBUG can see the pong response from kik to every ping i send
Closing this in favor of #71 .
Hello, it was already discussed on another thread (https://github.com/tomer8007/kik-bot-api-unofficial/issues/71) that the bot will hang when internet disconnects, i think i can solve this by myself. What is happening to me is that even if internet is on, the bot stop listening to events after a while (let's say 5 minutes). So if i send a message from another account to the bot account it won't be logged by the bot. How can I solve this?