Skip to content

Commit b9b2735

Browse files
ruralsceneryokue
authored andcommitted
TextComponent add documented attribute maxLines (#192)
1 parent 4b9ba90 commit b9b2735

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

linebot/models/flex_message.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ class TextComponent(FlexComponent):
429429
"""
430430

431431
def __init__(self, text=None, flex=None, margin=None, size=None, align=None, gravity=None,
432-
wrap=None, weight=None,
432+
wrap=None, maxLines=None, weight=None,
433433
color=None, action=None, **kwargs):
434434
r"""__init__ method.
435435
@@ -457,6 +457,7 @@ def __init__(self, text=None, flex=None, margin=None, size=None, align=None, gra
457457
self.align = align
458458
self.gravity = gravity
459459
self.wrap = wrap
460+
self.maxLines = maxLines
460461
self.weight = weight
461462
self.color = color
462463
self.action = get_action(action)

tests/models/test_flex_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_flex_message(self):
4444
body=BoxComponent(
4545
layout='vertical',
4646
contents=[
47-
TextComponent(text='hello'),
47+
TextComponent(text='hello', wrap=True, maxLines=1),
4848
TextComponent(text='world')
4949
]
5050
)

0 commit comments

Comments
 (0)