tomer8007 / kik-bot-api-unofficial

Python API for writing unoffical Kik bots that act like humans
MIT License
128 stars 77 forks source link

Added ability to send images. #124

Closed wolfieanmol closed 5 years ago

tomer8007 commented 5 years ago

Great feature. Just a few minor things:

wolfieanmol commented 5 years ago

Images go out as multiple packets because image data is too big.

And yeah, will fix them.

tomer8007 commented 5 years ago

Hmm, is there currently a flow in the code in which a list is passed to _send_xmpp_element?

wolfieanmol commented 5 years ago

In the serialize method of OutgoingChatImage, I'm dividing the data in packets of length 16384.

packets = [data[s:s+16384].encode() for s in range(0,len(data), 16384)] return list(packets)

When the data is sent as a single packet. The server takes 3-5 seconds to respond with <ack> which clearly showed that it was waiting for another packet. Also, the received image is in multiple packets (2 packets generally).