How to prevent null value in utterance template?

  - text: "Hey, {name}. How are you?"

For this example, or the following user supplied variables:

dispatcher.utter_template("utter_default", tracker, my_variable="my text")

If the variable is None, the utterance will contains a ‘None’ value, which is bad. How to prevent this and make sure that only when the template variable is not None, then its value will be filled; otherwise, it shouldn’t, since a “None” doesn’t look good in the output.

I assume you’re dispatching it from a custom action? If so, you could just check before if the variable is None and either set it to whatever default value you want or return a different message.

That’s true, thanks @sihsob