botmasterai / botmaster-socket.io

The socket.io Botmaster integration
MIT License
8 stars 8 forks source link

Correct use of "is typing" #8

Closed willemevenwel closed 6 years ago

willemevenwel commented 6 years ago

Enquiry NOT issues.

What event to I listen for when sending the is typing event to the clients connected, by using: bot.sendIsTypingMessageTo(update.sender.id);

If have tried all of these with no success: socket.on('typing', function(raw){ console.log("typing"); });

socket.on('is typing', function(raw){ console.log("is typing"); });

socket.on('istyping', function(raw){ console.log("istyping"); });

Does the flag that is typing is 'off' get sent by it self, and is it also an event? What event?

Regards,

Willem

jdwuarin commented 6 years ago

Hi @willemevenwel,

Support for isTyping is not there for socket.io bots. This can be seen in the code here:

https://github.com/botmasterai/botmaster-socket.io/blob/c3c32d0bce2410c1df483c2c528af9ac57e9ce6b/lib/socket.io_bot.js#L55

I.e. no senderAction are enabled.

Happy to review any pull request adding this capability to the library however. It's a small file, so shouldn't be too tricky to do. An update to the __sendMessage function in the library should do. Simply looking for the format of a typing indicator message and sending a different (recognizable) kind of event whenever it is detected should do.

willemevenwel commented 6 years ago

Thanks for the feedback, I close this issue.