Fix edge case when message object is undefined #37

Merged
laurynas-karvelis merged 1 commits from master into master 2018-02-01 15:49:58 +00:00
laurynas-karvelis commented 2018-02-01 15:05:43 +00:00 (Migrated from github.com)

It appears when communicating with telegram bot rapidly, entire message object sometimes becomes undefined, hence forcing node.js to throw an underfined 'chat' property error.

This is a quick fix, although it fixes the symptom, I'm not entirely sure it fixes the cause of this error.
Looking forward to your feedback.

Thank you for this awesome lib, BTW! :)

It appears when communicating with telegram bot rapidly, entire message object sometimes becomes undefined, hence forcing node.js to throw an underfined 'chat' property error. This is a quick fix, although it fixes the symptom, I'm not entirely sure it fixes the cause of this error. Looking forward to your feedback. Thank you for this awesome lib, BTW! :)
mdibaiee commented 2018-02-01 15:49:45 +00:00 (Migrated from github.com)

@laurynas-karvelis Thanks for the pull-request! I see, that makes sense, not all updates have a message property, it is an optional property. Sometimes there are edited_message, etc. instead. (https://core.telegram.org/bots/api#getting-updates)

anyways, I think your solution works! will publish a new version 👍

@laurynas-karvelis Thanks for the pull-request! I see, that makes sense, not all updates have a `message` property, it is an optional property. Sometimes there are `edited_message`, etc. instead. (https://core.telegram.org/bots/api#getting-updates) anyways, I think your solution works! will publish a new version :+1:
mdibaiee commented 2018-02-01 15:51:30 +00:00 (Migrated from github.com)

Published telegram-api@0.9.1

Published `telegram-api@0.9.1`
laurynas-karvelis commented 2018-02-01 15:55:40 +00:00 (Migrated from github.com)

Wow, that was a quick merge and publish! Once again, thanks a lot!

Wow, that was a quick merge and publish! Once again, thanks a lot!
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: thereadme/node-telegram-api#37
No description provided.