Closed RobinJayaswal closed 7 years ago
Can you solve the conflicts please? @RobinJayaswal
@anonrig Looks like another request you pulled in right before mine had also attempted to address the problem. I've kept his change, but I find that assigning message.intents
to be []
rather than simply undefined
is the more sensible option, as when you apply this middleware there is an understanding that intents will be appended. The current option doesn't have any advantages from what I can see and leads to more potential for errors.
Currently when a message with only an attachment is received (for example, a Facebook location message), the message gets caught up in this middleware and never reaches the controller.
This is because in the following code for receiving, there is a check to see if it has text, and if it does not then
next()
is never called:I have added a simple
else if
check that will also pass through other messages, setting an empty array for its intents, and callingnext()