botmasterai / botmaster-fulfill

a text-friendly way to integrate actions with your bot. Supply an object of action-functions that can return synchronously or asynchronously and replace text in the response, generate new responses, or do what the response claims to do.
MIT License
4 stars 2 forks source link

"No response after fulfill or response is not a string" if text not returned #10

Closed duncsand closed 7 years ago

duncsand commented 7 years ago

If I have an action that doesn't return some text, I get errors in the logs such as: UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: "No response after fulfill or response is not a string". In outgoing middleware

Everything works, but these errors clutter the place somewhat.

If my action is something like the following, I have no text to reply, as I'm actually sending a new message instead. If I change the return to return 'hi' the error goes away - but I don't want to do that.

buttons: {
    controller: (params, next) => {
        const buttonTitles = params.content.split(',');
        next().then(() => {
            params.bot.sendDefaultButtonMessageTo(buttonTitles, params.update.sender.id, 'Please select an option or type in your own');
        });
        return '';
    },
},
jwickens commented 7 years ago

fixed as part of 4.x