-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Messenger Platform 1.1 features #26
Conversation
@remixz Can you merge this please? |
please merge @remixz |
Please merge @remixz |
Please Merge and huge thanks to @eXeDK 🎆 |
Would be useful to add: https://developers.facebook.com/docs/messenger-platform/thread-settings/greeting-text To show an initial greeting 😄 |
Bump |
@eXeDK Hey! Thanks for your contribution 😄, sorry I'm so late. I'll agree with @iMicknl that tests should be included for 100% coverage, plus we'd probably want documentation as well. However, I'm gonna add you as a contributor to this repo now, since you've been super helpful in other issues, which I really appreciate. If you want to merge this just to get things started, and work on tests later, go for it. I'll make sure to keep an eye on things, and do a release once everything's good. |
@@ -104,6 +162,11 @@ class Bot extends EventEmitter { | |||
this._handleEvent('message', event) | |||
} | |||
|
|||
// handle echos | |||
if (event.message && event.message.is_echo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (event.message.is_echo) { ... }
would be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not true. you would get a typeError if message was undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
if (event.message) {
if (event.message.is_echo) {
this._handleEvent('echoMessage', event)
} else {
this._handleEvent('message', event)
}
}
It should be Plus, I would handle unknown events: if (event.oneCallbackType) {
... handle it ...
} else if (event.othercallbackType) {
... handle it ...
} else if ( ... ){ // as many as needed
... handle these too ...
} else {
console.error('Webhook received an unknown messaging event: ', JSON.stringify(event))
} |
…emovePersistentMenu
I went ahead and finished this PR with full test coverage and documentation. Thank you for your hard work on this! Released as 2.4.0. |
No description provided.