@@ -41,7 +41,7 @@ def __init__(self, id=None, **kwargs):
41
41
class TextMessage (Message ):
42
42
"""TextMessage.
43
43
44
- https://devdocs .line.me /en/#text-message
44
+ https://developers .line.biz /en/reference/messaging-api/#wh-text
45
45
46
46
Message object which contains the text sent from the source.
47
47
"""
@@ -62,67 +62,86 @@ def __init__(self, id=None, text=None, **kwargs):
62
62
class ImageMessage (Message ):
63
63
"""ImageMessage.
64
64
65
- https://devdocs .line.me /en/#image-message
65
+ https://developers .line.biz /en/reference/messaging-api/#wh-image
66
66
67
67
Message object which contains the image content sent from the source.
68
68
The binary image data can be retrieved with the Content API.
69
69
"""
70
70
71
- def __init__ (self , id = None , ** kwargs ):
71
+ def __init__ (self , id = None , content_provider = None , ** kwargs ):
72
72
"""__init__ method.
73
73
74
74
:param str id: Message ID
75
+ :param content_provider: ContentProvider object
76
+ :type content_provider: :py:class:`linebot.models.messages.ContentProvider`
75
77
:param kwargs:
76
78
"""
77
79
super (ImageMessage , self ).__init__ (id = id , ** kwargs )
78
80
79
81
self .type = 'image'
82
+ self .content_provider = self .get_or_new_from_json_dict (
83
+ content_provider , ContentProvider
84
+ )
80
85
81
86
82
87
class VideoMessage (Message ):
83
88
"""VideoMessage.
84
89
85
- https://devdocs .line.me /en/#video-message
90
+ https://developers .line.biz /en/reference/messaging-api/#wh-video
86
91
87
92
Message object which contains the video content sent from the source.
88
93
The binary video data can be retrieved with the Content API.
89
94
"""
90
95
91
- def __init__ (self , id = None , ** kwargs ):
96
+ def __init__ (self , id = None , duration = None , content_provider = None , ** kwargs ):
92
97
"""__init__ method.
93
98
94
99
:param str id: Message ID
100
+ :param long duration: Length of video file (milliseconds)
101
+ :param content_provider: ContentProvider object
102
+ :type content_provider: :py:class:`linebot.models.messages.ContentProvider`
95
103
:param kwargs:
96
104
"""
97
105
super (VideoMessage , self ).__init__ (id = id , ** kwargs )
98
106
99
107
self .type = 'video'
108
+ self .duration = duration
109
+ self .content_provider = self .get_or_new_from_json_dict (
110
+ content_provider , ContentProvider
111
+ )
100
112
101
113
102
114
class AudioMessage (Message ):
103
115
"""AudioMessage.
104
116
105
- https://devdocs .line.me /en/#audio-message
117
+ https://developers .line.biz /en/reference/messaging-api/#wh-audio
106
118
107
119
Message object which contains the audio content sent from the source.
108
120
The binary audio data can be retrieved with the Content API.
109
121
"""
110
122
111
- def __init__ (self , id = None , ** kwargs ):
123
+ def __init__ (self , id = None , duration = None , content_provider = None , ** kwargs ):
112
124
"""__init__ method.
113
125
114
126
:param str id: Message ID
127
+ :param long duration: Length of audio file (milliseconds)
128
+ :param content_provider: ContentProvider object
129
+ :type content_provider: :py:class:`linebot.models.messages.ContentProvider`
115
130
:param kwargs:
116
131
"""
117
132
super (AudioMessage , self ).__init__ (id = id , ** kwargs )
118
133
119
134
self .type = 'audio'
135
+ self .duration = duration
136
+ self .content_provider = self .get_or_new_from_json_dict (
137
+ content_provider , ContentProvider
138
+ )
120
139
121
140
122
141
class LocationMessage (Message ):
123
142
"""LocationMessage.
124
143
125
- https://devdocs .line.me /en/#location-message
144
+ https://developers .line.biz /en/reference/messaging-api/#wh-location
126
145
"""
127
146
128
147
def __init__ (self , id = None , title = None , address = None , latitude = None , longitude = None ,
@@ -148,7 +167,7 @@ def __init__(self, id=None, title=None, address=None, latitude=None, longitude=N
148
167
class StickerMessage (Message ):
149
168
"""StickerMessage.
150
169
151
- https://devdocs .line.me /en/#sticker-message
170
+ https://developers .line.biz /en/reference/messaging-api/#wh-sticker
152
171
153
172
Message object which contains the sticker data sent from the source.
154
173
For a list of basic LINE stickers and sticker IDs, see sticker list.
@@ -172,7 +191,7 @@ def __init__(self, id=None, package_id=None, sticker_id=None, **kwargs):
172
191
class FileMessage (Message ):
173
192
"""FileMessage.
174
193
175
- https://devdocs .line.me /en/#file-message
194
+ https://developers .line.biz /en/reference/messaging-api/#wh-file
176
195
177
196
Message object which contains the file content sent from the source.
178
197
The binary file data can be retrieved with the Content API.
@@ -191,3 +210,21 @@ def __init__(self, id=None, file_name=None, file_size=None, **kwargs):
191
210
self .type = 'file'
192
211
self .file_size = file_size
193
212
self .file_name = file_name
213
+
214
+
215
+ class ContentProvider (Base ):
216
+ """Content provider."""
217
+
218
+ def __init__ (self , type = None , original_content_url = None , preview_image_url = None , ** kwargs ):
219
+ """__init__ method.
220
+
221
+ :param str type: Provider of the content. `line` or `external`.
222
+ :param str original_content_url: URL of the content.
223
+ :param str preview_image_url: URL of the preview image.
224
+ :param kwargs:
225
+ """
226
+ super (ContentProvider , self ).__init__ (** kwargs )
227
+
228
+ self .type = type
229
+ self .original_content_url = original_content_url
230
+ self .preview_image_url = preview_image_url
0 commit comments