@@ -8,6 +8,7 @@ class _Response(object):
88 def __init__ (self , speech , display_text = None , is_ssml = False ):
99
1010 self ._speech = speech
11+ self ._display_text = display_text
1112 self ._integrations = current_app .config .get ("INTEGRATIONS" , [])
1213 self ._messages = [{"text" : {"text" : [speech ]}}]
1314
@@ -27,7 +28,7 @@ def __init__(self, speech, display_text=None, is_ssml=False):
2728 }
2829
2930 if "ACTIONS_ON_GOOGLE" in self ._integrations :
30- self ._integrate_with_actions (speech , display_text , is_ssml )
31+ self ._integrate_with_actions (self . _speech , self . _display_text , is_ssml )
3132
3233 def add_msg (self , speech , display_text = None , is_ssml = False ):
3334 self ._messages .append ({"text" : {"text" : [speech ]}})
@@ -167,11 +168,15 @@ def build_list(self, title=None, items=None):
167168
168169 """
169170
170- list_card = _ListSelector (self ._speech , title , items )
171+ list_card = _ListSelector (
172+ self ._speech , display_text = self ._display_text , title = title , items = items
173+ )
171174 return list_card
172175
173176 def build_carousel (self , items = None ):
174- carousel = _CarouselCard (self ._speech , items )
177+ carousel = _CarouselCard (
178+ self ._speech , display_text = self ._display_text , items = items
179+ )
175180 return carousel
176181
177182
@@ -197,8 +202,8 @@ class _CardWithItems(_Response):
197202 Provides the meth:add_item method.
198203 """
199204
200- def __init__ (self , speech , items = None ):
201- super (_CardWithItems , self ).__init__ (speech )
205+ def __init__ (self , speech , display_text = None , items = None ):
206+ super (_CardWithItems , self ).__init__ (speech , display_text )
202207 self ._items = items or list ()
203208 self ._add_message () # possibly call this later?
204209
@@ -236,10 +241,10 @@ def include_items(self, *item_objects):
236241class _ListSelector (_CardWithItems ):
237242 """Subclass of basic _Response to provide an instance capable of adding items."""
238243
239- def __init__ (self , speech , title = None , items = None ):
244+ def __init__ (self , speech , display_text = None , title = None , items = None ):
240245 self ._title = title
241246
242- super (_ListSelector , self ).__init__ (speech , items )
247+ super (_ListSelector , self ).__init__ (speech , display_text , items )
243248
244249 def _add_message (self ):
245250 self ._messages .append (
@@ -253,8 +258,8 @@ def _add_message(self):
253258class _CarouselCard (_ListSelector ):
254259 """Subclass of _CardWithItems used to build Carousel cards."""
255260
256- def __init__ (self , speech , items = None ):
257- super (_CarouselCard , self ).__init__ (speech , items = items )
261+ def __init__ (self , speech , display_text = None , items = None ):
262+ super (_CarouselCard , self ).__init__ (speech , display_text , items = items )
258263
259264 def _add_message (self ):
260265 self ._messages .append (
0 commit comments