@@ -100,7 +100,10 @@ class ButtonsTemplate(Template):
100
100
Template message with an image, title, text, and multiple action buttons.
101
101
"""
102
102
103
- def __init__ (self , text = None , title = None , thumbnail_image_url = None , actions = None , ** kwargs ):
103
+ def __init__ (self , text = None , title = None , thumbnail_image_url = None ,
104
+ image_aspect_ratio = None ,
105
+ image_size = None , image_background_color = None ,
106
+ actions = None , ** kwargs ):
104
107
"""__init__ method.
105
108
106
109
:param str text: Message text.
@@ -114,6 +117,19 @@ def __init__(self, text=None, title=None, thumbnail_image_url=None, actions=None
114
117
Aspect ratio: 1:1.51
115
118
Max width: 1024px
116
119
Max: 1 MB
120
+ :param str image_aspect_ratio: Aspect ratio of the image.
121
+ Specify one of the following values:
122
+ rectangle: 1.51:1
123
+ square: 1:1
124
+ :param str image_size: Size of the image.
125
+ Specify one of the following values:
126
+ cover: The image fills the entire image area.
127
+ Parts of the image that do not fit in the area are not displayed.
128
+ contain: The entire image is displayed in the image area.
129
+ A background is displayed in the unused areas to the left and right
130
+ of vertical images and in the areas above and below horizontal images.
131
+ :param str image_background_color: Background color of image.
132
+ Specify a RGB color value.
117
133
:param actions: Action when tapped.
118
134
Max: 4
119
135
:type actions: list[T <= :py:class:`linebot.models.template.TemplateAction`]
@@ -125,6 +141,9 @@ def __init__(self, text=None, title=None, thumbnail_image_url=None, actions=None
125
141
self .text = text
126
142
self .title = title
127
143
self .thumbnail_image_url = thumbnail_image_url
144
+ self .image_aspect_ratio = image_aspect_ratio
145
+ self .image_size = image_size
146
+ self .image_background_color = image_background_color
128
147
self .actions = _get_actions (actions )
129
148
130
149
@@ -161,12 +180,24 @@ class CarouselTemplate(Template):
161
180
Template message with multiple columns which can be cycled like a carousel.
162
181
"""
163
182
164
- def __init__ (self , columns = None , ** kwargs ):
183
+ def __init__ (self , columns = None , image_aspect_ratio = None ,
184
+ image_size = None , ** kwargs ):
165
185
"""__init__ method.
166
186
167
187
:param columns: Array of columns.
168
- Max: 5
188
+ Max: 10
169
189
:type columns: list[T <= :py:class:`linebot.models.template.CarouselColumn`]
190
+ :param str image_aspect_ratio: Aspect ratio of the image.
191
+ Specify one of the following values:
192
+ rectangle: 1.51:1
193
+ square: 1:1
194
+ :param str image_size: Size of the image.
195
+ Specify one of the following values:
196
+ cover: The image fills the entire image area.
197
+ Parts of the image that do not fit in the area are not displayed.
198
+ contain: The entire image is displayed in the image area.
199
+ A background is displayed in the unused areas to the left and right
200
+ of vertical images and in the areas above and below horizontal images.
170
201
:param kwargs:
171
202
"""
172
203
super (CarouselTemplate , self ).__init__ (** kwargs )
@@ -180,6 +211,8 @@ def __init__(self, columns=None, **kwargs):
180
211
column , CarouselColumn
181
212
))
182
213
self .columns = new_columns
214
+ self .image_aspect_ratio = image_aspect_ratio
215
+ self .image_size = image_size
183
216
184
217
185
218
class ImageCarouselTemplate (Template ):
@@ -194,7 +227,7 @@ def __init__(self, columns=None, **kwargs):
194
227
"""__init__ method.
195
228
196
229
:param columns: Array of columns.
197
- Max: 5
230
+ Max: 10
198
231
:type columns: list[T <= :py:class:`linebot.models.template.ImageCarouselColumn`]
199
232
:param kwargs:
200
233
"""
@@ -217,7 +250,8 @@ class CarouselColumn(Base):
217
250
https://devdocs.line.me/en/#column-object
218
251
"""
219
252
220
- def __init__ (self , text = None , title = None , thumbnail_image_url = None , actions = None , ** kwargs ):
253
+ def __init__ (self , text = None , title = None , thumbnail_image_url = None ,
254
+ image_background_color = None , actions = None , ** kwargs ):
221
255
"""__init__ method.
222
256
223
257
:param str text: Message text.
@@ -231,6 +265,8 @@ def __init__(self, text=None, title=None, thumbnail_image_url=None, actions=None
231
265
Aspect ratio: 1:1.51
232
266
Max width: 1024px
233
267
Max: 1 MB
268
+ :param str image_background_color: Background color of image.
269
+ Specify a RGB color value.
234
270
:param actions: Action when tapped.
235
271
Max: 3
236
272
:type actions: list[T <= :py:class:`linebot.models.template.TemplateAction`]
@@ -241,6 +277,7 @@ def __init__(self, text=None, title=None, thumbnail_image_url=None, actions=None
241
277
self .text = text
242
278
self .title = title
243
279
self .thumbnail_image_url = thumbnail_image_url
280
+ self .image_background_color = image_background_color
244
281
self .actions = _get_actions (actions )
245
282
246
283
0 commit comments