How to slot type list separated by commas in utter function

if i have slot list with values as [‘1’, ‘2’] then in utter function

“number user {number_slot}” -> result as “number user [‘1’, ‘2’]” .

Now i want result is: “number user {number_slot}” -> result as “number user 1, 2”

please help me

I’m not sure where and how you create the utter but maybe try something like {number_slot[0], number_slot[1]}

@rbossie oh not working, and i want show all values of slot type list

Hm, can you use a custom action?

Then you could do something like:

def NumbUser(Action):
   def name(self):
       return "action_number_user"
   def run(self, dispatcher, tracker, domain):
      numb_user_list = tracker.get_slot("number_slot")
      numb_user_string = ', '.join(numb_user_list)
      dispatcher.utter_message("number user" + numb_user_string)

thanks alot @rbossie

I thought about it. But with the custom action, how can I answer 1 or more answers?

For example

utter_xin_chao:

 - text: Hi, what can I do for you
 - text: Hi, I'm a restaurant bot, call me if you need help

If I use the custom action I can only answer 1

You can use dispatcher.utter_template(utter_xin_chao, tracker) to do this. But I’m not sure how to do this in combination with number_slot. Except for when you are satisfied if the bot utters:

Number user:

1,2

In that case you could use

def NumbUser(Action):
   def name(self):
       return "action_number_user"
   def run(self, dispatcher, tracker, domain):
      numb_user_list = tracker.get_slot("number_slot")
      numb_user_string = ', '.join(numb_user_list)
      dispatcher.utter_template("utter_numbuser", tracker)
      dispatcher.utter_message(numb_user_string)